/* TicketStorm CSS - Complete Styling */

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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --dark-bg: #1F2937;
    --light-bg: #F9FAFB;
    --border-color: #E5E7EB;
    --text-dark: #111827;
    --text-light: #6B7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--light-bg);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Landing Page */
.landing-page .hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    text-align: center;
    padding: 100px 20px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-page .hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.landing-page .tagline {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    font-size: 18px;
    padding: 15px 40px;
    min-width: 150px;
}

/* Features Section */
.features {
    padding: 80px 20px;
    background-color: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--text-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    background-color: var(--light-bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-box .logo h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.auth-box .logo p {
    color: var(--text-light);
}

.auth-form h2 {
    margin-bottom: 25px;
    color: var(--text-dark);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.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(79, 70, 229, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 14px;
}

.auth-form .btn {
    width: 100%;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links p {
    margin: 8px 0;
    color: var(--text-light);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Message Box */
.message-box {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message-box.success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.message-box.error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.message-box.hidden {
    display: none;
}

/* Navbar */
.navbar {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.user-info {
    color: var(--text-light);
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
    min-height: calc(100vh - 80px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-dark);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tickets Container */
.tickets-container {
    display: grid;
    gap: 20px;
}

.ticket-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.ticket-header h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.ticket-description {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.ticket-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-open {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-in-progress {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-resolved {
    background-color: #D1FAE5;
    color: #065F46;
}

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

/* Priority */
.priority {
    font-weight: 600;
}

.priority-low {
    color: #10B981;
}

.priority-medium {
    color: #F59E0B;
}

.priority-high {
    color: #EF4444;
}

.priority-critical {
    color: #DC2626;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading & Empty States */
.loading,
.empty-state,
.error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
}

.error {
    color: var(--danger-color);
}

.empty-state a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content.large {
    max-width: 1000px;
}

.modal-close {
    position: sticky;
    top: 10px;
    right: 10px;
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--danger-color);
    background-color: var(--light-bg);
}

/* Ticket Detail */
.ticket-detail {
    padding: 30px;
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.ticket-detail-header h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.ticket-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.ticket-info-grid div {
    font-size: 14px;
}

.ticket-info-grid strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 5px;
}

.ticket-description-full {
    margin-bottom: 30px;
}

.ticket-description-full h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.ticket-description-full p {
    color: var(--text-light);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Comments Section */
.comments-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.comments-list {
    margin-bottom: 25px;
}

.comment {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--border-color);
}

.comment.admin-comment {
    background-color: #EEF2FF;
    border-left-color: var(--primary-color);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comment-header strong {
    color: var(--text-dark);
}

.admin-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.comment-time {
    color: var(--text-light);
    font-size: 13px;
    margin-left: auto;
}

.comment p {
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-wrap;
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
}

.comment-form {
    margin-top: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    min-height: 100px;
    margin-bottom: 10px;
    font-family: inherit;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Form Container */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

.ticket-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

/* Admin Controls */
.admin-controls {
    background-color: #F0F9FF;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #BAE6FD;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-page .hero h1 {
        font-size: 2.5rem;
    }
    
    .landing-page .tagline {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 14px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .ticket-header {
        flex-direction: column;
    }
    
    .ticket-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .ticket-detail-header {
        flex-direction: column;
    }
    
    .ticket-info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .ticket-detail {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .filter-bar,
    .btn,
    .modal-close,
    .comment-form {
        display: none !important;
    }
}
