/* UI Components and Styling */

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
    margin: 8px 0;
}

.btn-secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.6);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

/* Button Loading States */
.btn .btn-loading {
    display: none;
}

.btn.btn-loading .btn-text {
    display: none;
}

.btn.btn-loading .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.btn-loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn.btn-loading:hover {
    transform: none;
}

/* Code sent state */
.btn.code-sent .btn-text::after {
    content: " ✓ Code Sent";
}

.btn.code-sent {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    opacity: 0.8;
}

/* Loading Spinner */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Back Button */
.back-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #4F46E5;
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    transform: translateX(-2px);
}

/* Form Components */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(209, 213, 219, 0.8);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

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

.file-input {
    padding: 12px !important;
    border: 2px dashed rgba(209, 213, 219, 0.8) !important;
    background: rgba(249, 250, 251, 0.9) !important;
}

.file-info {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.menu-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.menu-item:hover::before {
    left: 100%;
}

.menu-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.menu-item h3 {
    color: #1F2937;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
}

.menu-item p {
    color: #6B7280;
    font-size: 15px;
    line-height: 1.5;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card h3 {
    color: #6B7280;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1F2937;
}

.stat-number.urgent {
    color: #DC2626;
}

/* Manager Dashboard Table Styling - FONT CONSISTENCY FIX */
/* Added: Saturday, July 28, 2025 - Fix for font size/weight inconsistency */

.manager-dashboard-table,
.dashboard-table,
table.ticket-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.manager-dashboard-table th,
.dashboard-table th,
table.ticket-table th {
    background: rgba(79, 70, 229, 0.1);
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid rgba(79, 70, 229, 0.1);
}

/* CONSISTENT FONT STYLING FOR ALL TABLE CELLS */
.manager-dashboard-table td,
.dashboard-table td,
table.ticket-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    /* STANDARDIZED FONT PROPERTIES */
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151;
    line-height: 1.4;
}

/* Override ticket component styles when used in tables */
.manager-dashboard-table .ticket-title,
.dashboard-table .ticket-title,
table.ticket-table .ticket-title {
    /* OVERRIDE: Make title column consistent with other columns */
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 0 !important;
}

.manager-dashboard-table .ticket-meta,
.dashboard-table .ticket-meta,
table.ticket-table .ticket-meta {
    /* STANDARDIZED: Ensure meta columns use consistent styling */
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

.manager-dashboard-table .ticket-description,
.dashboard-table .ticket-description,
table.ticket-table .ticket-description {
    /* STANDARDIZED: Ensure description columns use consistent styling */
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

.manager-dashboard-table .ticket-number,
.dashboard-table .ticket-number,
table.ticket-table .ticket-number {
    /* KEEP: Ticket numbers can remain slightly different for identification */
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #4F46E5 !important;
}

/* Age column specific styling */
.manager-dashboard-table .ticket-age,
.dashboard-table .ticket-age,
table.ticket-table .ticket-age {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6B7280 !important;
}

/* Status badges in tables */
.manager-dashboard-table .ticket-status,
.dashboard-table .ticket-status,
table.ticket-table .ticket-status {
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table hover effects */
.manager-dashboard-table tbody tr:hover,
.dashboard-table tbody tr:hover,
table.ticket-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
    cursor: pointer;
}

/* Responsive table styling */
@media (max-width: 768px) {
    .manager-dashboard-table th,
    .dashboard-table th,
    table.ticket-table th,
    .manager-dashboard-table td,
    .dashboard-table td,
    table.ticket-table td {
        padding: 8px 6px;
        font-size: 13px !important;
    }
}

/* Ticket List Components */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ticket-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ticket-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ticket-number {
    font-weight: 700;
    color: #4F46E5;
    font-size: 14px;
}

.ticket-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open { background: #DBEAFE; color: #1D4ED8; }
.status-progress { background: #FEF3C7; color: #D97706; }
.status-pending { background: #FCE7F3; color: #BE185D; }
.status-resolved { background: #D1FAE5; color: #065F46; }
.status-closed { background: #F3F4F6; color: #374151; }

.ticket-title {
    font-weight: 600;
    color: #111827;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.ticket-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ticket-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low { background: #F3F4F6; color: #6B7280; }
.priority-medium { background: #FEF3C7; color: #92400E; }
.priority-high { background: #FED7AA; color: #C2410C; }
.priority-urgent { background: #FECACA; color: #DC2626; }

.ticket-date, .ticket-type {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.ticket-description {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

/* Ticket Filters */
#ticketFilters {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Ticket Detail Components */
.ticket-detail {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(79, 70, 229, 0.1);
}

.ticket-detail-number {
    font-weight: 700;
    color: #4F46E5;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.ticket-detail-title {
    color: #111827;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.ticket-detail-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ticket-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 12px;
}

.meta-item {
    color: #374151;
}

.meta-item strong {
    color: #111827;
    font-weight: 600;
}

.ticket-description-section {
    margin-bottom: 24px;
}

.ticket-description-section h3 {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.ticket-description-full {
    background: rgba(249, 250, 251, 0.8);
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #4F46E5;
    color: #374151;
    line-height: 1.6;
}

/* Attachments Section */
.attachments-section {
    margin-bottom: 24px;
}

.attachments-section h3 {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(209, 213, 219, 0.5);
}

.attachment-name {
    color: #374151;
    font-weight: 500;
}

/* Manager Controls */
.manager-controls {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.manager-controls h3 {
    color: #92400E;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.control-group {
    margin-bottom: 16px;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.control-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(209, 213, 219, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
}

/* Comments Section */
.comments-section {
    margin-bottom: 24px;
}

.comments-section h3 {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

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

.no-comments {
    color: #6B7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 8px;
}

.comment-item {
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid rgba(209, 213, 219, 0.5);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-header strong {
    color: #111827;
    font-weight: 600;
}

.comment-date {
    color: #6B7280;
    font-size: 12px;
}

.comment-text {
    color: #374151;
    line-height: 1.5;
}

.add-comment-section {
    background: rgba(239, 246, 255, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.add-comment-section h4 {
    color: #1E40AF;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6B7280;
    font-size: 16px;
}

.error-message {
    background: rgba(254, 202, 202, 0.9);
    color: #DC2626;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    text-align: center;
    margin: 20px 0;
}

.no-tickets {
    text-align: center;
    padding: 40px;
    color: #6B7280;
    font-size: 16px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(209, 213, 219, 0.5);
}