/* ========================================
   MAIL PAGE - CSS
   ======================================== */

/* Page Header */
.page-header {
    padding: 100px 0 30px;
    text-align: center;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    background: var(--earth-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--earth-text-muted);
}

/* Mail Content */
.mail-content {
    padding: 0 0 80px;
}

/* Mail Tabs */
.mail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.mail-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(26, 58, 92, 0.5);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    color: var(--earth-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mail-tab svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.mail-tab:hover {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
    color: var(--earth-text);
}

.mail-tab:hover svg {
    opacity: 1;
}

.mail-tab.active {
    background: var(--earth-gradient);
    border-color: transparent;
    color: var(--earth-dark);
    font-weight: 600;
}

.mail-tab.active svg {
    opacity: 1;
    stroke: var(--earth-dark);
}

.tab-count {
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mail-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Mail Actions */
.mail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(26, 58, 92, 0.4);
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-bottom: none;
}

/* Hide tabs section styles - no longer needed */
.mail-tabs {
    display: none;
}

.mail-select-all {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--earth-text-muted);
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 170, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--earth-primary);
    border-color: var(--earth-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--earth-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.mail-btns {
    display: flex;
    gap: 10px;
}

.btn-mail-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    color: var(--earth-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mail-action svg {
    width: 16px;
    height: 16px;
}

.btn-mail-action:hover {
    background: rgba(0, 212, 170, 0.2);
}

.btn-mail-action.delete {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.1);
}

.btn-mail-action.delete:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* Mail List Container */
.mail-list-container {
    background: rgba(26, 58, 92, 0.3);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.mail-list {
    display: block;
}

/* Mail Item */
.mail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mail-item:last-child {
    border-bottom: none;
}

.mail-item:hover {
    background: rgba(0, 212, 170, 0.08);
}

.mail-item.unread {
    background: rgba(0, 212, 170, 0.05);
}

.mail-item.unread .mail-subject {
    font-weight: 600;
    color: var(--earth-text);
}

/* Mail Status */
.mail-status {
    width: 50px;
    display: flex;
    justify-content: center;
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--earth-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--earth-primary);
}

.read-status {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 212, 170, 0.2);
    color: var(--earth-primary);
}

.read-status.unread {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Mail Info */
.mail-info {
    flex: 1;
    min-width: 0;
}

.mail-sender {
    font-size: 0.85rem;
    color: var(--earth-text-muted);
    margin-bottom: 5px;
}

.mail-subject {
    font-size: 1rem;
    color: var(--earth-text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mail-subject .badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin {
    background: linear-gradient(135deg, #00d4aa 0%, #00ff88 100%);
    color: var(--earth-dark);
}

.badge.support {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: #fff;
}

.badge.bonus {
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    color: var(--earth-dark);
}

.badge.system {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #fff;
}

.mail-preview {
    font-size: 0.85rem;
    color: var(--earth-text-muted);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.mail-date {
    font-size: 0.8rem;
    color: var(--earth-text-muted);
    opacity: 0.5;
}

/* Mail Pagination */
.mail-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 58, 92, 0.5);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 10px;
    color: var(--earth-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn svg {
    width: 18px;
    height: 18px;
}

.page-btn:hover:not(:disabled) {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
    color: var(--earth-text);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 58, 92, 0.5);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 10px;
    color: var(--earth-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-num:hover {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
}

.page-num.active {
    background: var(--earth-gradient);
    border-color: transparent;
    color: var(--earth-dark);
    font-weight: 600;
}

/* Mail Detail Modal */
.mail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.mail-modal.active {
    opacity: 1;
    visibility: visible;
}

.mail-modal-content {
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    background: linear-gradient(180deg, rgba(26, 58, 92, 0.98) 0%, rgba(10, 22, 40, 0.98) 100%);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mail-modal.active .mail-modal-content {
    transform: scale(1);
}

.mail-modal-content .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--earth-text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.mail-modal-content .modal-close:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

/* Mail Detail Header */
.mail-detail-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid rgba(0, 212, 170, 0.15);
    position: relative;
}

.mail-detail-badge {
    margin-bottom: 10px;
}

.mail-detail-subject {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--earth-text);
    margin-bottom: 15px;
    padding-right: 50px;
}

.mail-detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mail-detail-sender,
.mail-detail-date {
    font-size: 0.9rem;
    color: var(--earth-text-muted);
}

.mail-detail-sender::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--earth-primary);
    border-radius: 50%;
    margin-right: 8px;
}

/* Mail Detail Body */
.mail-detail-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    color: var(--earth-text);
    line-height: 1.8;
    font-size: 1rem;
}

.mail-detail-body p {
    margin-bottom: 15px;
}

/* Mail Detail Actions */
.mail-detail-actions {
    padding: 20px 30px;
    border-top: 1px solid rgba(0, 212, 170, 0.15);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-delete-mail {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-mail svg {
    width: 18px;
    height: 18px;
}

.btn-delete-mail {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

.btn-delete-mail:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .mail-tabs {
        flex-direction: column;
    }

    .mail-tab {
        justify-content: center;
    }

    .mail-actions {
        flex-direction: column;
        gap: 15px;
    }

    .mail-btns {
        width: 100%;
        justify-content: center;
    }

    .mail-item {
        flex-wrap: wrap;
        padding: 15px;
    }

    .mail-status {
        width: auto;
        order: -1;
    }

    .mail-info {
        width: 100%;
        padding-left: 30px;
    }

    .mail-subject {
        font-size: 0.95rem;
    }

    .mail-detail-header {
        padding: 25px 20px 15px;
    }

    .mail-detail-subject {
        font-size: 1.2rem;
    }

    .mail-detail-body {
        padding: 20px;
    }

    .mail-detail-actions {
        padding: 15px 20px;
        flex-direction: column;
    }

    .btn-delete-mail {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 500px) {
    .checkbox-label span:not(.checkmark) {
        display: none;
    }

    .mail-preview {
        display: none;
    }

    .page-numbers {
        gap: 3px;
    }

    .page-num,
    .page-btn {
        width: 35px;
        height: 35px;
    }
}
