/* Support System CSS - PULR Technologies Inc. */

/* CSS Variables */
:root {
    --primary-color: #3498db;
    --secondary-color: #95a5a6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --background-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --header-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dark Theme Variables */
body.dark-theme {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #444;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Fixed Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.header-left h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

.language-btn, .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.language-btn:hover, .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-login {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Container */
.container {
    max-width: 1400px;
    margin: calc(var(--header-height) + 30px) auto 30px;
    padding: 0 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

body.dark-theme .card {
    background: #2d2d2d;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    color: white;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2, .card-header h3 {
    display: inline;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-header i {
    margin-right: 10px;
}

.card-body {
    padding: 25px;
}

.welcome-card .card-header {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn i {
    margin-right: 5px;
}

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

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-success:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

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

.form-group label i {
    margin-right: 5px;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: white;
    color: var(--text-color);
}

body.dark-theme .form-control {
    background: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

body.dark-theme .form-text {
    color: #aaa;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Quill Editor Styling */
.ql-toolbar {
    border: 1px solid var(--border-color) !important;
    border-radius: 5px 5px 0 0 !important;
    background: #f8f9fa !important;
}

body.dark-theme .ql-toolbar {
    background: #3d3d3d !important;
    border-color: #555 !important;
}

.ql-container {
    border: 1px solid var(--border-color) !important;
    border-top: none !important;
    border-radius: 0 0 5px 5px !important;
    font-size: 0.95rem;
    background: white;
}

body.dark-theme .ql-container {
    background: #3d3d3d;
    border-color: #555 !important;
    color: #e0e0e0;
}

body.dark-theme .ql-editor {
    color: #e0e0e0;
}

/* File Upload */
.file-list {
    margin-top: 10px;
}

.file-preview {
    list-style: none;
    padding: 0;
}

.file-preview li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 5px;
}

body.dark-theme .file-preview li {
    background: #3d3d3d;
}

.file-preview i {
    color: var(--primary-color);
}

.file-size {
    color: #666;
    font-size: 0.85rem;
}

/* Tabs */
.tabs-container {
    position: sticky;
    top: var(--header-height);
    background: var(--background-color);
    z-index: 100;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 5px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

body.dark-theme .tabs {
    background: #2d2d2d;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(52, 152, 219, 0.1);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.tab-btn i {
    margin-right: 8px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

body.dark-theme .stat-card {
    background: #2d2d2d;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

body.dark-theme .stat-label {
    color: #aaa;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: #f8f9fa;
}

body.dark-theme .data-table thead {
    background: #3d3d3d;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

body.dark-theme .data-table tbody tr:hover {
    background: #3d3d3d;
}

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

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

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: white;
}

.badge-admin {
    background: #9b59b6;
    color: white;
    margin-left: 5px;
}

/* Status Badges */
.status-new {
    background: #3498db;
    color: white;
}

.status-in_progress {
    background: #f39c12;
    color: white;
}

.status-in_test {
    background: #1abc9c;
    color: white;
}

.status-resolved {
    background: #2ecc71;
    color: white;
}

.status-closed {
    background: #95a5a6;
    color: white;
}

/* Clickable Status Badges */
.status-clickable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.status-clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-clickable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    margin-left: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.status-clickable:hover::after {
    opacity: 1;
}

/* Priority Badges */
.priority-low {
    background: #3498db;
    color: white;
}

.priority-medium {
    background: #f39c12;
    color: white;
}

.priority-high {
    background: #e67e22;
    color: white;
}

.priority-urgent {
    background: #e74c3c;
    color: white;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
}

.login-box {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

body.dark-theme .login-container {
    background-color: #1e293b;
}

body.dark-theme .login-box {
    background: #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 200px;
    height: 60px;
    margin-bottom: 20px;
}

.login-header h2 {
    color: #1e293b;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

body.dark-theme .login-header h2 {
    color: #e2e8f0;
}

.login-box .form-group label {
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 6px;
}

body.dark-theme .login-box .form-group label {
    color: #e2e8f0;
}

.login-box .form-control {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.login-box .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.dark-theme .login-box .form-control {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
}

body.dark-theme .login-box .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-box .btn-primary {
    background-color: #2563eb;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.login-box .btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #1d4ed8;
}

body.dark-theme .login-footer a {
    color: #3b82f6;
}

body.dark-theme .login-footer a:hover {
    color: #60a5fa;
}

.login-copyright {
    text-align: center;
    margin-top: 40px;
    color: #64748b;
    font-size: 13px;
}

body.dark-theme .login-copyright {
    color: #94a3b8;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Ticket Details */
.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
}

body.dark-theme .meta-item {
    background: #3d3d3d;
}

.meta-item i {
    color: var(--primary-color);
}

.meta-item strong {
    margin-right: 5px;
}

.ticket-description {
    line-height: 1.8;
    font-size: 0.95rem;
}

.ticket-description p {
    margin-bottom: 10px;
}

.ticket-description ul, .ticket-description ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* Attachments */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    transition: var(--transition);
}

body.dark-theme .attachment-item {
    background: #3d3d3d;
}

.attachment-item:hover {
    background: #e9ecef;
}

body.dark-theme .attachment-item:hover {
    background: #4d4d4d;
}

.attachment-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.attachment-meta {
    font-size: 0.85rem;
    color: #666;
}

body.dark-theme .attachment-meta {
    color: #aaa;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.customer-comment {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

body.dark-theme .customer-comment {
    background: #1e3a5f;
}

.admin-comment {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

body.dark-theme .admin-comment {
    background: #3a1e4f;
}

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

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.comment-time {
    font-size: 0.85rem;
    color: #666;
}

body.dark-theme .comment-time {
    color: #aaa;
}

.comment-body {
    line-height: 1.6;
}

/* Utility Classes */
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

body.dark-theme .no-data {
    color: #aaa;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        padding: 0 15px;
    }

    .header-left h1 {
        font-size: 1.1rem;
    }

    .header-logo {
        height: 35px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

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

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

    .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .fixed-header,
    .tabs-container,
    .form-actions,
    .btn {
        display: none !important;
    }

    .container {
        margin-top: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

body.dark-theme .modal-header .close-btn:hover {
    background-color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    padding-top: 0;
}

/* Modal Form Styles */
.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

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

.modal-body label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.modal-body .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: var(--transition);
}

.modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-body .form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--secondary-color);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}
