/**
 * Support Ticket System - Main Stylesheet
 * 
 * This file contains all the CSS styling for the application
 */

/* ============================================
   Reset and Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #111827;
    background-color: #f5f6fa; /* neutral dashboard background */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ============================================
   Header Styles
   ============================================ */
header {
    background-color: #ffffff;
    color: #111827;
    padding: 0.9rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    background: #111827;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(17,24,39,0.18);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: #111827;
    text-decoration: none;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: rgba(17,24,39,0.04);
}

nav a:hover {
    background-color: rgba(17,24,39,0.12);
    transform: translateY(-1px);
}

.user-info {
    color: #4b5563;
    font-size: 0.95rem;
    background: #eef2ff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
}

.btn-logout {
    background-color: #f05252;
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
}

.btn-logout:hover {
    background-color: #e02424;
}

/* ============================================
   Main Content
   ============================================ */
main {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================
   Forms
   ============================================ */
.card,
.form-container,
.ticket-details,
.replies-section,
.table-container,
.chart-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.form-container {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    background-color: #111827;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(17,24,39,0.16);
}

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

.btn-success {
    background-color: #16a34a;
}

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

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

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

.btn-secondary {
    background-color: #6b7280;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Utility layout helpers */
.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    margin-top: 1rem;
}

.chart-card {
    background: #f1fbf3;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 1.5rem;
}

/* ============================================
   Alerts/Messages
   ============================================ */
.alert {
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border-left: 5px solid;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.alert-success {
    background-color: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #3498db;
    color: #0c5460;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    padding: 1.5rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: #111827;
}

table tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   Ticket Cards
   ============================================ */
.ticket-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #0ea5e9;
}

.ticket-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.ticket-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-open {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-in-progress {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-closed {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-low {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-medium {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-high {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* ============================================
   Dashboard Stats
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    font-size: 2.2rem;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.stat-card p {
    color: #6b7280;
    font-weight: 600;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 10px;
    background: radial-gradient(circle at top right, rgba(14,165,233,0.12), transparent 40%);
    pointer-events: none;
}

/* ============================================
   Ticket Details
   ============================================ */
.ticket-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.ticket-details h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.detail-row {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.detail-label {
    font-weight: 600;
    width: 150px;
    color: #7f8c8d;
}

.detail-value {
    flex: 1;
}

/* ============================================
   Replies Section
   ============================================ */
.replies-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.reply-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.reply-author {
    font-weight: 600;
    color: #2c3e50;
}

.reply-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.reply-message {
    color: #333;
    line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 0 12px;
    }

    main.container {
        padding-top: 1.5rem;
    }
    
    .nav-toggle {
        display: block;
        width: 100%;
        text-align: center;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .form-container,
    .ticket-details,
    .replies-section,
    .table-container,
    .chart-card {
        padding: 1.25rem;
        margin: 1.25rem auto;
    }

    table th,
    table td {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row .btn,
    .action-row .btn-secondary,
    .action-row .btn-success {
        width: 100%;
        text-align: center;
    }

    .btn-small {
        width: auto;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.no-tickets {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.no-tickets p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

