/**
 * FlashTech Portal — Public CSS
 * Styles for client area, ticketing, downloads
 */

/* ========================================
   Portal Base
   ======================================== */
.ft-portal {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ft-portal h2 {
    color: #1e2a4a;
    margin-top: 0;
}

.ft-portal h3 {
    color: #1e2a4a;
}

/* ========================================
   Auth Pages (Login/Register)
   ======================================== */
.ft-auth-container {
    max-width: 480px;
    margin: 2rem auto;
}

.ft-auth-card {
    padding: 2.5rem;
}

.ft-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ft-auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.ft-auth-header p {
    color: #868e96;
    font-size: 0.9375rem;
}

.ft-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9375rem;
}

.ft-auth-footer a {
    color: #e8b84b;
    font-weight: 600;
}

/* Form Rows */
.ft-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .ft-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.ft-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ft-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.ft-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
}

.ft-link-sm {
    font-size: 0.875rem;
    color: #c99a2e;
}

.ft-link-sm:hover {
    color: #e8b84b;
}

.ft-text-muted {
    color: #868e96;
    font-size: 0.8125rem;
}

.ft-text-danger {
    color: #e74c3c;
}

.ft-text-bold {
    font-weight: 700;
}

/* ========================================
   Dashboard
   ======================================== */
.ft-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.ft-dashboard-welcome h2 {
    margin-bottom: 0.25rem;
}

.ft-dashboard-welcome p {
    color: #868e96;
    margin: 0;
}

.ft-dashboard-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

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

.ft-stat-card {
    text-align: center;
    padding: 1.5rem;
}

.ft-stat-card__number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e2a4a;
    line-height: 1;
}

.ft-stat-card__label {
    font-size: 0.8125rem;
    color: #868e96;
    margin-top: 0.5rem;
}

/* Tabs */
.ft-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.ft-tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #868e96;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}

.ft-tab:hover {
    color: #1e2a4a;
}

.ft-tab--active {
    color: #1e2a4a;
    border-bottom-color: #e8b84b;
    font-weight: 600;
}

/* Section Panel */
.ft-section-panel {
    margin-bottom: 2rem;
}

.ft-section-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ft-section-panel__header h3 {
    margin: 0;
}

/* Empty State */
.ft-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.ft-empty-state h3 {
    margin-bottom: 0.5rem;
}

.ft-empty-state p {
    color: #868e96;
    margin-bottom: 1.5rem;
}

/* Quick Links */
.ft-quick-links {
    margin-top: 2rem;
}

.ft-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    text-align: center;
}

.ft-quick-link__icon {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
    color: #e8b84b;
}

.ft-quick-link__title {
    font-weight: 600;
    color: #1e2a4a;
    font-size: 0.9375rem;
}

/* ========================================
   Page Headers
   ======================================== */
.ft-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ft-page-header h2 {
    margin: 0;
}

.ft-page-subtitle {
    color: #868e96;
    margin: -0.5rem 0 1.5rem;
}

.ft-page-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   Filters
   ======================================== */
.ft-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ft-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #495057;
    background: #f1f3f5;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.ft-filter-btn:hover {
    background: #e9ecef;
    color: #1e2a4a;
}

.ft-filter-btn--active {
    background: #1e2a4a;
    color: #fff;
}

.ft-filter-btn--active:hover {
    background: #2a3a5c;
    color: #fff;
}

.ft-filter-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========================================
   Tickets
   ======================================== */
.ft-clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}

.ft-clickable-row:hover {
    background: #f8f9fa !important;
}

.ft-sla-overdue {
    background: #fce4ec !important;
}

/* Ticket Single */
.ft-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ft-ticket-header__left a {
    font-size: 0.8125rem;
}

.ft-ticket-header h2 {
    margin: 0.25rem 0 0;
    font-size: 1.375rem;
}

.ft-ticket-id {
    color: #868e96;
    font-weight: 400;
}

.ft-ticket-header__badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Ticket Meta */
.ft-ticket-meta {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.ft-ticket-meta__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    font-size: 0.875rem;
}

/* Ticket Messages */
.ft-ticket-message {
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.ft-ticket-message--original {
    border-left: 4px solid #e8b84b;
}

.ft-ticket-message--client {
    border-left: 4px solid #3498db;
}

.ft-ticket-message--operator {
    border-left: 4px solid #1e2a4a;
}

.ft-ticket-message--internal {
    background: #fffde7;
    border-left: 4px solid #f39c12;
}

.ft-ticket-message__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.875rem;
}

.ft-ticket-message__body {
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* Ticket Attachments */
.ft-ticket-attachments {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f5;
    font-size: 0.8125rem;
}

.ft-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ft-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: #f1f3f5;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-size: 0.8125rem;
    transition: background 0.15s;
}

.ft-attachment:hover {
    background: #e9ecef;
    color: #1e2a4a;
}

.ft-attachment small {
    color: #868e96;
}

/* Ticket Thread */
.ft-ticket-thread {
    margin-top: 1.5rem;
}

.ft-ticket-thread h3 {
    margin-bottom: 1rem;
}

/* Reply Form */
.ft-ticket-reply-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
}

.ft-ticket-reply-form h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Close ticket */
.ft-ticket-close {
    margin-top: 1rem;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ft-ticket-close p {
    margin: 0;
    font-size: 0.875rem;
    color: #868e96;
}

/* ========================================
   File Upload
   ======================================== */
.ft-file-upload {
    position: relative;
}

.ft-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.ft-file-upload__area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}

.ft-file-upload__area:hover,
.ft-file-upload.ft-dragover .ft-file-upload__area {
    border-color: #e8b84b;
    background: rgba(232, 184, 75, 0.05);
}

.ft-file-upload__area--compact {
    flex-direction: row;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.ft-file-upload__icon {
    font-size: 2rem;
    color: #868e96;
}

.ft-file-upload__text {
    font-weight: 500;
    color: #495057;
}

.ft-file-upload__hint {
    font-size: 0.75rem;
    color: #adb5bd;
}

.ft-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ft-file-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ========================================
   Form Actions
   ======================================== */
.ft-form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* ========================================
   Downloads
   ======================================== */
.ft-download-categories {
    margin-bottom: 2rem;
}

.ft-downloads-grid {
    margin-bottom: 2rem;
}

.ft-download-card {
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.ft-download-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ft-download-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ft-download-card__icon {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    color: #e8b84b;
}

.ft-download-card__category {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
}

.ft-download-card__title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    color: #1e2a4a;
}

.ft-download-card__desc {
    font-size: 0.8125rem;
    color: #868e96;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.ft-download-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f5;
}

.ft-download-card__count {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* ========================================
   Profile Form
   ======================================== */
.ft-profile-form hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 1.5rem 0;
}

.ft-profile-form h4 {
    margin: 0 0 1rem;
    color: #1e2a4a;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .ft-portal {
        padding: 1rem 0.75rem;
    }

    .ft-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ft-ticket-header {
        flex-direction: column;
    }

    .ft-ticket-meta__grid {
        grid-template-columns: 1fr;
    }

    .ft-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ft-auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ft-stats-grid {
        grid-template-columns: 1fr;
    }

    .ft-form-actions {
        flex-direction: column;
    }

    .ft-form-actions .ft-btn {
        width: 100%;
    }
}
