/* styles.css - Main stylesheet for Support Queue System */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 2rem;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control-sm {
    padding: 5px 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.required {
    color: #dc3545;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.inline-form {
    display: inline-block;
    margin-right: 10px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    height: 42px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background-color: #f8f9fa;
}

/* Details rows for tickets */
.details-row {
    display: none;
    background-color: #f8f9fa;
}

.ticket-details {
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

/* Priority indicators */
.priority-normal {
    border-left: 4px solid #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.priority-high {
    border-left: 4px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.priority-urgent {
    border-left: 4px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Priority badges */
.priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.normal {
    background-color: #28a745;
    color: white;
}

.priority-badge.high {
    background-color: #ffc107;
    color: #212529;
}

.priority-badge.urgent {
    background-color: #dc3545;
    color: white;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.waiting {
    background-color: #6c757d;
    color: white;
}

.status-badge.in_progress {
    background-color: #007bff;
    color: white;
}

.status-badge.completed {
    background-color: #28a745;
    color: white;
}

/* Category badges */
.category-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #17a2b8;
    color: white;
}

/* Agent badges */
.agent-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #6f42c1;
    color: white;
}

/* Call count badges */
.call-count-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #fd7e14;
    color: white;
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-number.urgent-stat {
    color: #dc3545;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

/* Agent workload cards */
.agent-workload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.agent-workload-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.agent-workload-card.selected-agent {
    border-color: #007bff;
}

.agent-workload-card h4 {
    margin-bottom: 15px;
    color: #333;
}

.workload-stats {
    display: flex;
    justify-content: space-around;
}

.workload-stat {
    text-align: center;
}

.workload-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.workload-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Login form */
.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Queue position indicator */
.queue-position {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    text-align: center;
    margin: 20px 0;
}

/* No data message */
.no-data {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .agent-workload-grid {
        grid-template-columns: 1fr;
    }
}