/* Base styles - Mobile-first design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #111111;
    --accent: #DB3D24;
    --bg: #f9f9f9;
    --text: #111111;
    --border: #ddd;
    --success: #4CAF50;
    --error: #f44336;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent zoom on input focus iOS */
    touch-action: manipulation;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
}

h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 15px;
}

h1 {
    font-size: 28px;
    line-height: 1.2;
}

h2 {
    font-size: 24px;
    line-height: 1.3;
}

h3 {
    font-size: 20px;
    line-height: 1.4;
}

p {
    margin-bottom: 12px;
}

/* Buttons - large touch targets for mobile */
.btn {
    display: inline-block;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    min-width: 100%;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg);
}

.btn-primary:active {
    background-color: #333;
    transform: scale(0.98);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:active {
    background-color: #e6004a;
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:active {
    background-color: #555;
    transform: scale(0.98);
}

.btn:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Navigation */
nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

nav .btn {
    width: 100%;
}

/* Health check */
.health-check {
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#health-status {
    font-size: 16px;
}

/* Admin styles */
.admin-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
}

.admin-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.admin-nav a {
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.admin-nav a.active {
    background: var(--accent);
}

.admin-section {
    background: white;
    padding: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-section h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

/* Tables - mobile responsive */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th, td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 14px;
}

td {
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 6px;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 0, 85, 0.1);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 16px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tablet and up */
@media (min-width: 768px) {
    body {
        font-size: 20px;
    }
    
    .container {
        max-width: 1200px;
        padding: 40px 20px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 24px;
    }
    
    .btn {
        font-size: 20px;
        padding: 18px 36px;
        min-width: 200px;
    }
    
    nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    nav .btn {
        flex: 1;
        min-width: auto;
    }
    
    .admin-container {
        max-width: 1400px;
        padding: 40px 20px;
    }
    
    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .admin-nav a {
        flex: 1;
        min-width: auto;
    }
    
    .admin-section {
        padding: 30px;
    }
    
    .admin-section h2 {
        font-size: 32px;
    }
    
    table {
        display: table;
        font-size: 16px;
    }
    
    th, td {
        padding: 15px;
    }
    
    th {
        font-size: 18px;
    }
    
    td {
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .stat-value {
        font-size: 48px;
    }
    
    .stat-label {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 18px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea,
    .form-group select {
        font-size: 18px;
        padding: 15px;
    }
    
    .btn-primary:hover {
        background-color: #333;
        transform: scale(1.02);
    }
    
    .btn-accent:hover {
        background-color: #e6004a;
        transform: scale(1.02);
    }
    
    .btn-secondary:hover {
        background-color: #555;
        transform: scale(1.02);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    body {
        font-size: 22px;
    }
    
    h1 {
        font-size: 48px;
    }
    
    h2 {
        font-size: 36px;
    }
    
    .btn {
        font-size: 22px;
        padding: 20px 40px;
    }
}

