/* STCP - Smart Traffic Control Panel Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --cta-primary: #ff6b00;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    padding: 1rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

nav a:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.logout-btn {
    font-weight: 600;
    transition: all 0.2s;
    margin-left: auto;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
}

/* Main Content */
main {
    padding-bottom: 2rem;
}

section {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.recent-activity h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.click-controls {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.click-controls h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.control-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 100px;
}

.activity-text {
    flex: 1;
}

/* Forms */
.form-container {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.range-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.range-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.range-group input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: var(--bg-color);
}

table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background-color: var(--bg-color);
}

table a {
    color: var(--primary-color);
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

.domain-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.domain-link:hover {
    color: var(--cta-primary);
    text-decoration: underline;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-priority-1 {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-priority-2 {
    background-color: #fde68a;
    color: #78350f;
}

.badge-priority-3 {
    background-color: #fcd34d;
    color: #713f12;
}

.badge-priority-4 {
    background-color: #fbbf24;
    color: #78350f;
}

.badge-priority-5 {
    background-color: #f59e0b;
    color: #78350f;
}

/* Time Slots */
.time-slots {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.time-slot-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.time-slot-row label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot-row label:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
}

.time-slot-row input[type="checkbox"]:checked + span,
.time-slot-row input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    color: white;
}

.time-slot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Checklist */
.checklist-info {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.checklist-info p {
    margin-bottom: 0.5rem;
}

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checklist-item {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.checklist-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.checklist-item label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 0.75rem;
}

.checklist-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.checklist-text {
    flex: 1;
}

.checklist-text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.checklist-text small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.checklist-notes {
    margin-top: 2rem;
}

.checklist-notes h3 {
    margin-bottom: 1rem;
}

/* Reports */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.report-section {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.report-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.report-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.analytics-list {
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    nav {
        flex-direction: column;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .time-slot-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.5rem;
    }
}

/* Iframe compatibility */
body {
    min-height: auto;
}

/* Print styles */
@media print {
    header,
    nav,
    .btn,
    .form-actions {
        display: none;
    }
}

