/* Cabinet Specific Styles */
.cabinet-main {
    padding: 100px 0 60px;
    min-height: calc(100vh - 160px);
}

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

.header__user {
    font-weight: 600;
    color: var(--accent);
    margin-right: 10px;
}

.cabinet-header h1 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 2rem;
    color: var(--white);
}

.header-with-back {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.back-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent-light);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.project-card-premium {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 2px;
    /* For the gradient border effect */
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.project-card-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 107, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.4);
}

.project-card-premium:hover .card-glow {
    opacity: 1;
}

.card-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 107, 0, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.project-card-content {
    background: #1a1a1a;
    border-radius: 14px;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.project-icon-wrap {
    width: 48px;
    height: 48px;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.project-title {
    margin: 0;
    font-size: 1.4rem;
    font-family: var(--font-heading);
    color: var(--white);
    line-height: 1.2;
}

.project-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    font-family: var(--font-heading);
}

.project-progress {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
    transition: width 0.5s ease;
}

.project-card-footer {
    margin-top: auto;
}

.btn--full {
    width: 100%;
}

/* Empty State Improvement */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: radial-gradient(circle at center, rgba(255, 107, 0, 0.08) 0%, transparent 70%);
    border-radius: 20px;
    border: 1px dashed rgba(255, 107, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.empty-state__icon {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px rgba(255, 107, 0, 0.3));
}

.empty-msg {
    max-width: 400px;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Table */
.cabinet-table {
    width: 100%;
    border-collapse: collapse;
}

.cabinet-table th,
.cabinet-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 107, 0, 0.1);
}

.cabinet-table th {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.ticket-desc-short {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-Открыт {
    background: rgba(255, 107, 0, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.status-В-работе {
    background: rgba(0, 150, 255, 0.1);
    color: #0096ff;
    border: 1px solid #0096ff;
}

.status-Готово {
    background: rgba(0, 255, 100, 0.1);
    color: #00ff64;
    border: 1px solid #00ff64;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: #252525;
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--white);
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

.form-control--sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    margin: 10% auto;
    padding: 40px;
    width: 80%;
    max-width: 500px;
    border-radius: var(--radius);
    position: relative;
    border: 1px solid rgba(255, 107, 0, 0.3);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--white);
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    background: rgba(255, 107, 0, 0.05);
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 107, 0, 0.2);
}

/* Modal Tabs (for login/register on landing) */
.modal-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 107, 0, 0.1);
}

.modal-tab {
    padding: 10px 0;
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-muted);
    position: relative;
}

.modal-tab.active {
    color: var(--accent);
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.modal-pane {
    display: none;
}

.modal-pane.active {
    display: block;
}

.inline-form {
    display: inline-block;
}

/* Ticket List Improvements */
.ticket-row {
    cursor: pointer;
    transition: var(--transition);
}

.ticket-row:hover {
    background: rgba(255, 107, 0, 0.03);
}

.ticket-title-link {
    color: var(--white);
    transition: var(--transition);
}

.ticket-row:hover .ticket-title-link {
    color: var(--accent);
}

.ticket-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ticket Detail Page */
.ticket-header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
}

.ticket-info-card {
    margin-bottom: 30px;
}

.ticket-description-full {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--white);
    margin-bottom: 20px;
}

.ticket-meta-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

/* Chat Interface */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header h3 {
    margin: 0;
    font-family: var(--font-heading);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(0, 0, 0, 0.2);
}

.message {
    max-width: 80%;
    align-self: flex-start;
}

.message--own {
    align-self: flex-end;
}

.message-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.message--own .message-meta {
    flex-direction: row-reverse;
}

.message-author {
    font-weight: 700;
    color: var(--accent);
}

.message-time {
    color: var(--text-muted);
}

.message-content {
    background: #252525;
    padding: 14px 18px;
    border-radius: 4px 16px 16px 16px;
    color: var(--text);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message--own .message-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 16px 4px 16px 16px;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.message--admin .message-author {
    color: #00ff64;
}

/* File Attachments in Chat */
.message-files {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.file-attachment:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 0, 0.05);
}

.chat-input-area {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 15px;
}

.file-list-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-preview-item {
    font-size: 0.75rem;
    background: rgba(255, 107, 0, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--accent);
}

.empty-chat {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .cabinet-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .cabinet-table thead {
        display: none;
    }

    .cabinet-table tr {
        display: block;
        padding: 15px 0;
    }

    .cabinet-table td {
        display: block;
        padding: 8px 0;
        border: none;
    }
}

@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }

    .chat-wrapper {
        height: 500px;
    }

    .ticket-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}