@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #1e40af;
    /* Xanh dương đậm */
    --primary-hover: #1e3a8a;
    --secondary: #facc15;
    /* Vàng sao */
    --background: #fdfbf7;
    /* Giấy ngà */
    --surface: #ffffff;
    --surface-border: #d1d5db;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--background);
    background-image: url('../images/rd-background.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.saas-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none;
}

.glass {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0;
    width: 100%;
    background: #fffefe;
    border-radius: 2px;
    box-shadow: 0 0 2px 2px lavender;
    border: none;
}

h1,
h2,
h3,
h4 {
    font-family: 'Roboto', Arial, sans-serif;
}

.header-custom {
    position: relative;
    max-width: 1200px;
    padding: 2rem;
    border-radius: 10px;
    background-color: var(--primary);
    border-top: 4px solid var(--secondary);
    box-shadow: none;
}

.header-overlay {
    display: none;
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.header-logo {
    width: 100px;
    height: auto;
    background: #fff;
    border-radius: 50%;
    padding: 5px;
}

.header-text {
    text-align: left;
    color: #ffffff;
}

.header-text h2 {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.header-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.3;
    color: #ffffff;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

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

    .header-text h1 {
        font-size: 1.5rem;
    }
}

/* User Navigation Tabs - Modern Tech Style */
.user-nav {
    max-width: 1200px;
    margin: 0 auto 1.5rem auto;
    padding: 0;
}

.nav-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.user-tabs {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 3.5rem;
    overflow-x: auto;
    padding: 0.75rem 2rem;
    background: rgba(30, 64, 175, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(30, 64, 175, 0.15);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), inset 0 2px 0 rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
}

.user-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: none;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.user-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.user-tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.user-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.35);
    border: none;
}

.user-tab.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.45);
}

.tab-content {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

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

.report-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem;
    animation: fadeInUp 0.8s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--surface-border);
    border-radius: 2px;
    color: var(--text-primary);
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #adb5bd;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 2px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
    margin-top: 1rem;
    border: 1px solid var(--primary-hover);
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
    background: #e2e6ea;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 2rem;
    border-radius: 2px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.otp-input {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    background: #ffffff;
    border: 1px solid var(--surface-border);
    border-radius: 2px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-bar input {
    flex: 1;
}

/* Modern Table Wrapper */
.admin-panel>div[style*="overflow-x"] {
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--surface-border);
    background: #ffffff;
    margin-top: 1.5rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    border: none;
    margin-top: 0;
}

th,
td {
    padding: 1.2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

th {
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #64748b;
    background-color: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
}

tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
}

/* Action Buttons inside Table */
td .btn {
    padding: 0.5rem;
    border-radius: 8px;
    opacity: 0.85;
    transition: all 0.2s ease;
    margin-right: 0.4rem;
    box-shadow: none;
    background: transparent;
    border: 1px solid transparent;
}

td .btn:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

td .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--primary);
}

td .btn-primary {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    border: none;
}

td .btn-primary:hover {
    background: rgba(30, 64, 175, 0.2);
}

td .btn[style*="background: var(--error)"] {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--error) !important;
    border: none;
}

td .btn[style*="background: var(--error)"]:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e6f4ea;
    color: var(--success);
    border: 1px solid #cce8d6;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(30, 64, 175, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}


/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .report-form {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .user-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 1rem;
    }

    .user-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .user-tabs::-webkit-scrollbar-thumb {
        background: var(--surface-border);
        border-radius: 2px;
    }

    .user-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .otp-input {
        width: 35px;
        height: 45px;
        font-size: 1.2rem;
    }

    .nav-breadcrumb {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .nav-breadcrumb select {
        width: 100%;
    }
}

/* C�n d?i n�t Quay l?i v� Luu & Ti?p t?c */
.wizard-step>div[style*="display: flex"] {
    gap: 1rem;
}

.wizard-step .btn {
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .wizard-step .btn {
        min-width: unset;
        flex: 1;
        font-size: 0.9rem;
        padding: 0.8rem 0.5rem;
    }
}

.wizard-progress span:hover {
    color: var(--primary) !important;
    opacity: 0.8;
}


/* Wizard Step Header Balancing */
.wizard-step h3 {
    text-align: center;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--primary);
    letter-spacing: 0.5px;
    background-color: rgba(30, 64, 175, 0.05);
    border-radius: 8px;
    padding-top: 1rem;
}

/* Report Type Cards */
.report-type-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--surface-border);
}

.report-type-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-type-options {
    display: flex;
    gap: 1rem;
}

.report-type-card {
    flex: 1;
    cursor: pointer;
}

.report-type-card input {
    display: none;
}

.report-type-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s ease;
    height: 100%;
}

.report-type-card .card-icon {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.report-type-card span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.report-type-card:hover .card-content {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.report-type-card input:checked+.card-content {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.1);
}

.report-type-card input:checked+.card-content .card-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.report-type-card input:checked+.card-content span {
    color: var(--primary);
}

@media (max-width: 768px) {
    .report-type-options {
        flex-direction: column;
    }
}

/* Wizard Stepper */
.wizard-stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    position: relative;
    overflow-x: auto;
    gap: 1rem;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 80px;
}

.stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    /* center of circle */
    left: 50%;
    width: 100%;
    height: 3px;
    background-color: var(--surface-border);
    z-index: 1;
    transition: all 0.3s ease;
}

.stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--surface-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.stepper-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.stepper-item.active .stepper-circle {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.stepper-item.active .stepper-title {
    color: var(--primary);
    font-weight: 700;
}

.stepper-item.completed .stepper-circle {
    background-color: #10b981;
    /* green */
    border-color: #10b981;
    color: white;
}

.stepper-item.completed .stepper-title {
    color: #10b981;
}

.stepper-item.completed:not(:last-child)::after {
    background-color: #10b981;
}

.stepper-item:hover .stepper-circle {
    border-color: var(--primary);
    color: var(--primary);
}

.stepper-item.active:hover .stepper-circle,
.stepper-item.completed:hover .stepper-circle {
    color: white;
}

/* --- Tự động thêm dấu * cho trường bắt buộc --- */
.form-group:has([required])>label::after,
label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
    content: " *";
    color: #ef4444 !important;
    font-weight: bold;
}

/* Ẩn các dấu * thủ công để tránh lặp (chỉ ẩn các span chứa dấu *) */
.form-group:has([required])>label>span.req-star,
.form-group:has([required])>label>span.required,
label:has(+ input[required])>span.req-star,
label:has(+ select[required])>span.req-star,
label:has(+ textarea[required])>span.req-star,
.form-group:has([required])>label>span[style*="color:red"],
.form-group:has([required])>label>span[style*="color: red"],
label:has(+ input[required])>span[style*="color:red"],
label:has(+ select[required])>span[style*="color:red"],
label:has(+ textarea[required])>span[style*="color:red"] {
    display: none !important;
}

/* Media Links Grid - 2 columns */
.media-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .media-links-grid {
        grid-template-columns: 1fr;
    }
}

.media-list-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    height: 160px;
}

.media-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.media-list-img-wrapper {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
}

.media-list-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-list-placeholder {
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 2.5rem;
}

.media-list-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.media-list-title {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-list-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.85rem;
}

.media-list-date {
    color: #94a3b8;
}

.media-list-action {
    color: #3b82f6;
    font-weight: 500;
}

/* Modern Deadline Banner */
.modern-deadline-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(147, 197, 253, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modern-deadline-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #60a5fa);
    border-radius: 12px 0 0 12px;
}

.modern-deadline-banner .icon-wrapper {
    background: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
    color: #3b82f6;
}

.modern-deadline-banner .deadline-content {
    flex: 1;
}

.modern-deadline-banner .deadline-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.modern-deadline-banner .deadline-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

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