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

body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: #000000;
    overflow-x: hidden;
}

/* Colors */
:root {
    --primary: #40E0D0;
    --secondary: #20B2AA;
    --dark: #000000;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-gray: #e9ecef;
    --text-primary: #000000;
    --text-secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --gradient: linear-gradient(135deg, #40E0D0 0%, #20B2AA 100%);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    position: relative;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
}

.login-container {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.logo h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
}

.logo h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.logo-emoji {
    font-size: 1.5rem;
}

.login-logo {
    height: 50px;
    width: 50px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 0.75rem;
    /* Square logo with rounded corners */
}

.sidebar-logo {
    height: 35px;
    width: 35px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 0.5rem;
    /* Square logo with rounded corners */
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--white);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.login-button {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-button:hover {
    transform: translateY(-2px);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.demo-info {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    margin-top: 1rem;
}

.demo-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.demo-info p:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border-gray);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--light-gray);
    color: var(--text-primary);
}

.sidebar-nav .nav-link.active {
    background: rgba(64, 224, 208, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-gray);
}

.logout-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: none;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: #fee;
    border-color: var(--danger);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-gray);
    border-radius: 25px;
    width: 300px;
    background: var(--light-gray);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.notifications {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-gray);
}

.admin-profile span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.add-button {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.add-button:hover {
    transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.stat-change.positive {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.stat-change.neutral {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.chart-placeholder {
    height: 300px;
    background: var(--light-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.recent-activities {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.recent-activities h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-gray);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--light-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.activity-info p {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Data Table */
.table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--light-gray);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-gray);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-gray);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--light-gray);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.action-btn:hover {
    opacity: 0.7;
}

.action-btn.edit {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.action-btn.delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.modal-header h3 {
    color: var(--text-primary);
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.modal-form {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-form input,
.modal-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 1rem;
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.cancel-button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
}

.save-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    background: var(--gradient);
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.coming-soon i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--border-gray);
}

.coming-soon h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Payment Management Styles */
.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    background: var(--white);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.section-actions .add-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.section-actions .add-button:hover {
    background: var(--secondary);
}

.plan-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.plan-type-badge.monthly {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.plan-type-badge.custom {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary);
}

.payment-status-select {
    padding: 4px 8px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    background: var(--white);
    font-size: 12px;
}

.payment-status-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Status badges with additional colors */
.status-badge.warning {
    background: var(--warning);
    color: var(--white);
}

.status-badge.info {
    background: #17a2b8;
    color: var(--white);
}

/* Reports Section Styles */
.date-filter {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-filter input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--white);
}

.filter-btn {
    background: var(--gradient);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 224, 208, 0.3);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.report-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.report-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary);
}

.card-content {
    padding: 1.5rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.metric-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.growth-rate.positive {
    color: var(--success);
}

.growth-rate.negative {
    color: var(--danger);
}

.growth-rate.neutral {
    color: var(--text-secondary);
}

.chart-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.chart-container.large {
    min-height: 400px;
}

.chart-container.small {
    min-height: 150px;
}

.loading {
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-gray);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-container.small {
    max-height: 300px;
    overflow-y: auto;
}

.table-container.small table {
    font-size: 0.85rem;
}

.engagement-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.engagement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.engagement-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.engagement-item strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    .header-right .search-box {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        margin: 1rem;
        padding: 2rem;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .engagement-metrics {
        gap: 0.75rem;
    }
    
    .engagement-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chart-container {
        min-height: 250px;
    }
    
    .chart-container.large {
        min-height: 300px;
    }
}