/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header - Reduced height */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 0;
    margin-bottom: 10px;
    flex-shrink: 0;
}

header h1 {
    text-align: center;
    margin-bottom: 3px;
    font-size: 1.5rem;
}

.subtitle {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main content area - flexible */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

main.container {
    padding: 10px 20px;
}

/* Navigation */
.view-toggle {
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

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

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

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

/* Sections */
.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    border: 1px solid #e1e8ed;
}

.hidden {
    display: none;
}

/* Waitlist containers - natural flow */
#publicWaitlist,
#adminWaitlist,
#historyList {
    padding-right: 5px;
}

/* Admin view specific layout */
#adminView {
    gap: 15px;
}

#adminView section h3 {
    margin-bottom: 10px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

/* Waitlist items */
.waitlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.waitlist-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.waitlist-info {
    flex: 1;
}

.waitlist-info strong {
    color: #2c3e50;
    font-size: 1.1rem;
}

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

.action-btn {
    padding: 10px 18px;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.seat-btn {
    background-color: #27ae60;
}

.seat-btn:hover {
    background-color: #229954;
    transform: translateY(-1px);
}

.remove-btn {
    background-color: #e74c3c;
}

.remove-btn:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.empty-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
    font-size: 1rem;
}

/* Statistics */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 8px;
    color: white;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin actions */
.admin-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dialog styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.dialog {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: dialogSlideIn 0.3s ease;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dialog h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.dialog-content {
    margin-bottom: 30px;
    text-align: left;
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Virtual numpad styles */
.numpad-display {
    font-size: 2.5rem;
    letter-spacing: 15px;
    margin-bottom: 30px;
    min-height: 50px;
    font-family: monospace;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.numpad-btn {
    padding: 20px;
    font-size: 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.numpad-btn:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: translateY(-1px);
}

.numpad-btn:active {
    background: #dee2e6;
    transform: translateY(0);
}

/* Settings */
.settings-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

#restaurantName {
    border-color: #3498db;
    background-color: #f8f9ff;
}

/* Instructions and Privacy */
.privacy-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.privacy-notice h4 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.privacy-notice ul {
    margin-left: 20px;
}

.privacy-notice li {
    margin-bottom: 8px;
    color: #856404;
}

article {
    margin-bottom: 30px;
}

article h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

article ol,
article ul {
    margin-left: 20px;
}

article li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Footer - Reduced height */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 8px 10px;
    margin-top: 10px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.footer p {
    margin-bottom: 2px;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main.container {
        padding: 5px 10px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .waitlist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .waitlist-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .action-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .view-toggle {
        flex-direction: column;
        align-items: center;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .dialog {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .numpad-grid {
        gap: 10px;
    }
    
    .numpad-btn {
        padding: 15px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    main.container {
        padding: 5px 8px;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.65rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .waitlist-item {
        padding: 10px 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .footer {
        font-size: 0.65rem;
        padding: 6px 8px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 16px;
        bottom: 15px;
        right: 15px;
    }
} 