@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    color-scheme: light;
    supported-color-schemes: light;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    color: #1d1d1f;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    min-height: 100vh;
}

.wrapper {
    background-color: #ffffff;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.disclaimer {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
    padding: 16px;
    border-radius: 8px;
    margin-top: auto;
    font-size: 14px;
    line-height: 1.5;
}

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

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    /* Mobile-specific improvements */
    position: relative;
    box-sizing: border-box;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin: 0 0 10px 0;
}

.modal-subtitle {
    font-size: 16px;
    color: #86868b;
    margin: 0;
}

.modal-disclaimer {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
    padding: 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-disclaimer a {
    color: #0071e3;
    text-decoration: none;
}

.modal-disclaimer a:hover {
    text-decoration: underline;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.close {
    color: #86868b;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-top: -10px;
}

.close:hover {
    color: #000;
}

h1 {
    font-size: 36px;
    font-weight: 600;
    color: #000;
    margin: 0 0 10px 0;
    text-align: center;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 30px 0 15px 0;
}

.subheader {
    font-size: 16px;
    font-weight: 400;
    color: #86868b;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

p {
    font-size: 16px;
    line-height: 1.6;
    color: #424245;
    margin: 0 0 15px 0;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: #ffffff;
    color: #1d1d1f;
    transition: border-color 0.2s ease;
}

input[type="email"]:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0071e3;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    background-color: #0077ed;
}

.btn-secondary {
    background-color: #6e6e73;
}

.btn-secondary:hover {
    background-color: #7a7a7f;
}

.btn-danger {
    background-color: #ff3b30;
}

.btn-danger:hover {
    background-color: #ff453a;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #d1f2eb;
    color: #0d5c63;
    border: 1px solid #a8e6cf;
}

.alert-error {
    background-color: #fde8e8;
    color: #c53030;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.alert-warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

.subscribe-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
    margin: 20px 0;
}

.subscribe-form .form-group {
    margin-bottom: 0;
    flex: 1;
    max-width: 400px;
}

.subscribe-form .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .wrapper {
        padding: 15px;
    }
    
    h1 {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    h2 {
        font-size: 22px;
    }

    .subscribe-form {
        flex-direction: column;
        align-items: stretch;
        margin: 15px 0;
    }

    .subscribe-form .form-group {
        max-width: none;
        margin-bottom: 15px;
    }

    .modal-content {
        margin: 10px auto;
        padding: 20px;
        width: 95%;
        max-height: calc(100vh - 20px);
        height: calc(100vh - 20px);
        display: flex;
        flex-direction: column;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: auto;
        padding-top: 20px;
    }
    
    .modal-disclaimer {
        flex: 1;
        overflow-y: auto;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .modal-header {
        flex-shrink: 0;
    }
}

/* Admin Dashboard Styles */
.admin-logout {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.btn-logout {
    background: #dc3545;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover {
    background: #c82333;
    color: #ffffff;
    text-decoration: none;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 20px 0;
    text-align: center;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-card {
    grid-column: 1 / -1; /* Make it full width */
}

.growth-card .chart-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 16px;
    overflow: hidden; /* Prevent grid lines from extending outside */
}

.subscribers-table {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subscribers-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.subscribers-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.subscribers-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.subscribers-table tr:hover {
    background: #f8f9fa;
}

.subscribers-table tr.inactive {
    opacity: 0.6;
}

.subscribers-table tr.inactive:hover {
    opacity: 0.8;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-primary {
    background: #007bff;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0056b3;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Responsive admin styles */
@media (max-width: 768px) {
    .admin-logout {
        justify-content: center;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .subscribers-table {
        font-size: 12px;
    }
    
    .subscribers-table th,
    .subscribers-table td {
        padding: 12px 8px;
    }
    
    .subscribers-table th {
        font-size: 10px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .wrapper {
        padding: 10px;
    }
    
    h1 {
        font-size: 36px;
        margin-bottom: 6px;
    }
    
    .subheader {
        font-size: 16px;
        margin-bottom: 15px;
        line-height: 1.3;
    }
    
    .subscribe-form {
        margin: 10px 0;
    }
    
    .subscribe-form .form-group {
        margin-bottom: 12px;
    }
    
    input[type="email"] {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 16px;
    }
} 