/* ===================================
    CV DOWNLOAD MODAL STYLES
=================================== */

/* Modal Overlay */
.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.cv-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.cv-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    padding: 40px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 100px rgba(21, 96, 189, 0.15);
    overflow: hidden;
}

.cv-modal-overlay.active .cv-modal {
    transform: scale(1) translateY(0);
}

/* Modal Decorative Elements */
.cv-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(21, 96, 189, 0.08) 0%, transparent 50%);
    animation: modalGlow 4s ease-in-out infinite;
}

@keyframes modalGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Close Button */
.cv-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.cv-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.cv-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.6);
    transition: stroke 0.3s ease;
}

.cv-modal-close:hover svg {
    stroke: #ffffff;
}

/* Modal Icon */
.cv-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #1560BD 0%, #1560BD 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(21, 96, 189, 0.4);
    position: relative;
    z-index: 10;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.cv-modal-icon svg {
    width: 40px;
    height: 40px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
}

/* Modal Title */
.cv-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 10;
}

/* Modal Subtitle */
.cv-modal-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

/* CV Preview Card */
.cv-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 28px;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.cv-preview-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(21, 96, 189, 0.3);
}

.cv-preview-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cv-preview-icon {
    width: 50px;
    height: 60px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cv-preview-icon svg {
    width: 24px;
    height: 24px;
    stroke: #1560BD;
    fill: none;
}

.cv-preview-info {
    flex: 1;
}

.cv-preview-name {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.cv-preview-meta {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cv-preview-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Download Button */
.cv-download-btn {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #1560BD 0%, #1560BD 100%);
    border: none;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.cv-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cv-download-btn:hover::before {
    left: 100%;
}

.cv-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(21, 96, 189, 0.5);
}

.cv-download-btn:active {
    transform: translateY(0);
}

.cv-download-btn svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    fill: none;
    transition: transform 0.3s ease;
}

.cv-download-btn:hover svg {
    transform: translateY(2px);
}

/* Download Progress */
.cv-download-progress {
    display: none;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

.cv-download-progress.active {
    display: block;
}

.cv-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.cv-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.cv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1560BD, #1560BD);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Success State */
.cv-modal-success {
    display: none;
    text-align: center;
    position: relative;
    z-index: 10;
}

.cv-modal-success.active {
    display: block;
    animation: successFadeIn 0.5s ease;
}

@keyframes successFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.cv-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 10px 60px rgba(16, 185, 129, 0.6); }
}

.cv-success-icon svg {
    width: 40px;
    height: 40px;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cv-success-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.cv-success-message {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.cv-modal-content.hidden {
    display: none;
}

/* Modal Footer */
.cv-modal-footer {
    margin-top: 24px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.cv-modal-footer p {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 540px) {
    .cv-modal {
        padding: 30px 24px;
    }

    .cv-modal-title {
        font-size: 20px;
    }

    .cv-modal-icon {
        width: 70px;
        height: 70px;
    }

    .cv-preview-card {
        padding: 16px;
    }

    .cv-preview-icon {
        width: 44px;
        height: 52px;
    }
}

/* ===================================
    VISITOR STATS MODAL
=================================== */
#stats-modal-overlay .cv-modal {
    max-width: 560px;
}

.stats-modal-content {
    text-align: center;
}

.stats-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(21, 96, 189, 0.25), rgba(13, 74, 148, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.stats-modal-icon svg {
    width: 28px;
    height: 28px;
}

.stats-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stats-modal-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 20px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stats-summary-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stats-summary-num {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-light);
    font-variant-numeric: tabular-nums;
}

.stats-summary-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
}

.stats-chart-title,
.stats-countries-title {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
    margin-bottom: 12px;
}

.stats-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 24px;
}

.stats-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 4px;
}

.stats-chart-val {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

.stats-chart-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    min-height: 4px;
    transition: height 0.5s ease;
}

.stats-chart-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.45);
}

.stats-countries {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.stats-countries::-webkit-scrollbar {
    display: none;
}

.stats-countries {
    scrollbar-width: none;
}

.stats-country-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
}

.stats-country-flag {
    font-size: 1.3rem;
    line-height: 1;
}

.stats-country-name {
    flex: 1;
    text-align: left;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.stats-country-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
    font-variant-numeric: tabular-nums;
}

.stats-countries-empty {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px;
}

@media (max-width: 540px) {
    #stats-modal-overlay .cv-modal {
        max-width: 100%;
        padding: 24px 18px;
    }

    .stats-summary-num {
        font-size: 1.1rem;
    }

    .stats-chart {
        height: 130px;
        gap: 5px;
        padding: 8px 6px;
    }
}
