/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #000;
   /* background: #fff; */
    background: #f6f6f6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #000;
    color: #fff;
    padding: 1rem 0;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.subhome a {
    text-decoration: none;
    border: solid 1px;
    border-radius: 5px;
    padding: 3px;
    padding-left: 10px;
    padding-right: 10px;
    color: #fff;
    margin: 3px;
}

/* Filters Section */
.filters {
    background: #f5f5f5;
    padding: 1.5rem 0;
    border-bottom: 1px solid #ddd;
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.category-filter select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

.subscriptions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.subscriptions-table th,
.subscriptions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.subscriptions-table th {
    background: #f5f5f5;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.subscriptions-table th:hover {
    background: #e0e0e0;
}

.subscriptions-table th.sort-asc::after {
    content: ' ↑';
}

.subscriptions-table th.sort-desc::after {
    content: ' ↓';
}

.subscription-name {
    color: #000;
    text-decoration: none;
    font-weight: 600;
}

.subscription-name:hover {
    text-decoration: underline;
}

/* Description Toggle */
.description-toggle {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
}

.description-content {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.description-content.show {
    display: block;
}

/* Offer Info Tooltip */
.offer-info {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid #000;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: help;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    display: none;
    z-index: 1000;
}

.offer-info:hover .tooltip {
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button:hover:not(:disabled) {
    background: #f5f5f5;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    margin: 0 1rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.3rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.edit-btn {
    background: #000;
    color: white;
}

.delete-btn {
    background: #ff4444;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
}

.modal h2 {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Footer Styles */
.site-footer {
    background: #000;
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #333;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-nav a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-footer {
        padding: 1.5rem 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .subscriptions-table {
        font-size: 0.9rem;
    }
    
    .subscriptions-table th,
    .subscriptions-table td {
        padding: 0.5rem;
    }
    
    .admin-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.4rem;
    }
    
    .subscriptions-table {
        font-size: 0.8rem;
    }
}