/* Radio Entry System - CSS Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-bg: #34495e;
    --text-color: #2c3e50;
    --light-text: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 300;
}

.station-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.station-info > div {
    background: var(--light-bg);
    padding: 15px 25px;
    border-radius: var(--radius);
    font-size: 1.1em;
}

.operator strong, .frequency strong {
    color: var(--primary-color);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Entry Grid */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.entry-slot {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.entry-slot:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.slot-header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
}

.slot-number {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
}

.slot-content {
    padding: 30px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.callsign-display {
    font-size: 2em;
    font-weight: bold;
    color: var(--success-color);
    text-align: center;
    padding: 20px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: var(--radius);
    width: 100%;
}

.empty-slot {
    width: 100%;
    text-align: center;
}

.waiting {
    color: var(--light-text);
    font-style: italic;
    font-size: 1.1em;
}

.callsign-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
}

.callsign-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.submit-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
}

.submit-btn:hover:not(:disabled) {
    background: #219a52;
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: var(--light-text);
    cursor: not-allowed;
    transform: none;
}

/* Full Message */
.full-message {
    background: var(--warning-color);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: var(--radius);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Status Bar */
.status-bar {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.last-update, .auto-refresh {
    color: var(--light-text);
    font-size: 0.9em;
}

/* Footer */
footer {
    margin-top: 30px;
    text-align: center;
    color: rgba(255,255,255,0.8);
}

.admin-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.5);
}

.admin-link:hover {
    color: white;
    border-bottom-style: solid;
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
}

.nav-link.logout {
    background: var(--danger-color);
}

.nav-link.logout:hover {
    background: #c0392b;
}

/* Admin Sections */
.admin-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
}

/* Forms */
.config-form, .login-form {
    display: grid;
    gap: 20px;
    max-width: 600px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1em;
    transition: border-color 0.3s ease;
}

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

.config-info {
    margin-top: 15px;
    color: var(--light-text);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light-text);
    color: white;
}

.btn-secondary:hover {
    background: #6c7b7d;
}

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

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

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

.btn-warning:hover {
    background: #e67e22;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.login-btn {
    background: var(--success-color);
    color: white;
    padding: 15px;
    font-size: 1.1em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background: #219a52;
}

/* Entries Grid (Admin) */
.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.entry-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius);
    border-left: 4px solid var(--success-color);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--light-text);
}

.position-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.entry-callsign {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.entry-actions {
    text-align: right;
}

.bulk-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.status-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.status-title {
    color: var(--light-text);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.status-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

/* API Info */
.api-info {
    line-height: 1.8;
}

.api-info code {
    background: var(--light-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.api-test {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#api-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: var(--radius);
}

.api-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.api-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Flash Messages */
.flash-message {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: bold;
}

.flash-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.flash-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.flash-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
}

.flash-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 10% auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: var(--secondary-color);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    color: var(--light-text);
    font-size: 1.1em;
    padding: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .station-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .entry-grid {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .entries-grid {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        margin: 5% auto;
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .callsign-display {
        font-size: 1.5em;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .admin-nav, .submit-btn, .btn {
        display: none;
    }
}