/* ============================================================
   КВАЛИФИКАЦИЯ — ДИПЛОМЫ И СЕРТИФИКАТЫ ОБ ОБРАЗОВАНИИ
   ============================================================ */

.diplomas-section {
    padding: 80px 0 60px;
    background: rgba(0,0,0,0.4);
    position: relative; overflow: hidden;
}
.diplomas-section h2 { margin-bottom: 20px; }
.diplomas-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-size: 1.15em;
    margin: 0 0 50px;
    letter-spacing: 0.5px;
}

/* ============ КАРУСЕЛЬ ДИПЛОМОВ ============ */

.diplomas-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.diplomas-viewport {
    flex: 1;
    overflow: hidden;                 /* Скрывает всё, что за пределами */
    padding: 20px 0;
    position: relative;
}

.diplomas-track {
    display: flex;
    gap: 28px;
    width: max-content;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

/* ============ КАРТОЧКА ДИПЛОМА ============ */

.diploma-card {
    position: relative;
    width: 240px;
    height: 320px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-top-color: rgba(255, 235, 150, 0.55);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.35s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.diploma-card:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(212, 175, 55, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: var(--champagne);
}
.diploma-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.6s ease;
}
.diploma-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg,
        rgba(27, 10, 31, 0) 0%,
        rgba(27, 10, 31, 0.85) 40%,
        rgba(27, 10, 31, 0.98) 100%);
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.3;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}
.diploma-card::after {
    content: '';
    position: absolute;
    top: -50%; left: -100%;
    width: 60%; height: 200%;
    background: linear-gradient(100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.28) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 3;
}
.diploma-card:hover::after { animation: diplomaShine 1s ease-in-out; }
@keyframes diplomaShine {
    0%   { left: -100%; }
    100% { left: 200%; }
}
.diploma-zoom {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--champagne);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.diploma-card:hover .diploma-zoom { opacity: 1; }

/* ============ ЗЕЛЁНЫЕ АНИМИРОВАННЫЕ СТРЕЛКИ ============ */

.diploma-arrow {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 2em;
    line-height: 1;
    color: #052e16;
    text-shadow:
        0 2px 4px rgba(255, 255, 255, 0.55),
        0 -1px 2px rgba(0, 0, 0, 0.3);
    padding: 0 0 4px 0;
    z-index: 5;
    user-select: none;
    flex-shrink: 0;

    background: radial-gradient(circle at 35% 30%,
        #BBF7D0 0%,
        #86EFAC 25%,
        #22C55E 60%,
        #15803D 90%,
        #052e16 100%);

    box-shadow:
        0 0 30px rgba(34, 197, 94, 0.55),
        0 0 60px rgba(34, 197, 94, 0.35),
        inset 0 4px 8px rgba(255, 255, 255, 0.5),
        inset 0 -6px 12px rgba(0, 0, 0, 0.25);

    animation: diplomaArrowPulse 1.6s ease-in-out infinite;
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
}

.diploma-arrow::before,
.diploma-arrow::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid rgba(34, 197, 94, 0.6);
    animation: diplomaArrowRing 2s ease-out infinite;
    pointer-events: none;
}
.diploma-arrow::after { animation-delay: 1s; }

@keyframes diplomaArrowPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 30px rgba(34, 197, 94, 0.55),
            0 0 60px rgba(34, 197, 94, 0.35),
            inset 0 4px 8px rgba(255, 255, 255, 0.5),
            inset 0 -6px 12px rgba(0, 0, 0, 0.25);
    }
    50% {
        transform: scale(1.06);
        box-shadow:
            0 0 45px rgba(34, 197, 94, 0.85),
            0 0 90px rgba(34, 197, 94, 0.5),
            inset 0 4px 8px rgba(255, 255, 255, 0.6),
            inset 0 -6px 12px rgba(0, 0, 0, 0.25);
    }
}
@keyframes diplomaArrowRing {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.diploma-arrow:hover {
    transform: scale(1.15);
    box-shadow:
        0 0 55px rgba(34, 197, 94, 1),
        0 0 110px rgba(34, 197, 94, 0.6),
        inset 0 4px 10px rgba(255, 255, 255, 0.65),
        inset 0 -6px 12px rgba(0, 0, 0, 0.25);
    animation-play-state: paused;
}
.diploma-arrow:active {
    transform: scale(0.95);
}

/* ============ ЛАЙТБОКС ============ */
.diplomas-lightbox {
    position: fixed; inset: 0;
    background: rgba(10, 5, 15, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: none; align-items: center; justify-content: center;
    z-index: 3500; padding: 30px; cursor: zoom-out;
}
.diplomas-lightbox.active {
    display: flex;
    animation: diplomaFadeIn 0.3s ease-out;
}
@keyframes diplomaFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.diplomas-lightbox img {
    max-width: 92vw; max-height: 88vh;
    border-radius: 14px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(212, 175, 55, 0.4);
    cursor: default;
    animation: diplomaZoom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes diplomaZoom {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.diplomas-lightbox-close {
    position: absolute;
    top: 24px; right: 28px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; font-size: 1.3em;
    cursor: pointer; transition: all 0.25s;
    display: flex; align-items: center; justify-content: center;
}
.diplomas-lightbox-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* ============================================================
   РЕДАКТОР ДИПЛОМОВ В АДМИНКЕ
   ============================================================ */
.diplomas-editor {
    background: var(--card-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 24px;
    max-width: 1100px; margin: 0 auto;
}
.diplomas-admin-list {
    display: flex; flex-direction: column;
    gap: 14px; margin-top: 20px;
}
.diploma-edit-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px; align-items: start;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    transition: all 0.25s;
}
.diploma-edit-card:hover { border-color: rgba(212, 175, 55, 0.35); }
.diploma-edit-card.saved {
    background: rgba(52, 211, 153, 0.12);
    border-color: var(--emerald-soft);
}
.diploma-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.diploma-edit-fields input,
.diploma-edit-fields textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #444;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: border-color 0.2s;
    resize: vertical;
}
.diploma-edit-fields input:focus,
.diploma-edit-fields textarea:focus {
    outline: none;
    border-color: var(--champagne);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.diploma-edit-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.diploma-edit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88em;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    margin-top: 4px;
}
.diploma-edit-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--emerald-soft);
    cursor: pointer;
}
.diploma-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.diploma-edit-actions button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.diploma-file-input { display: none; }

/* ============================================================
   ДИПЛОМЫ — ТЕЛЕФОН / ПЛАНШЕТ
   ============================================================ */

@media (max-width: 900px) {
    .diplomas-section { padding: 50px 0 40px; }
    .diplomas-subtitle { font-size: 1em; margin-bottom: 30px; padding: 0 14px; }

    .diplomas-carousel { gap: 10px; padding: 0 10px; }
    .diplomas-track { gap: 16px; }
    .diploma-card { width: 200px; height: 267px; border-radius: 14px; }

    .diploma-arrow {
        width: 52px;
        height: 52px;
        font-size: 1.7em;
    }
    .diploma-arrow::before,
    .diploma-arrow::after { inset: -5px; border-width: 2px; }
}

@media (max-width: 600px) {
    .diplomas-section { padding: 32px 0 24px; }
    .diplomas-section h2 { margin-bottom: 12px; }
    .diplomas-subtitle { font-size: 0.95em; margin: 0 0 20px; padding: 0 14px; }

    .diplomas-carousel { gap: 6px; padding: 0 6px; }
    .diplomas-track { gap: 10px; }
    .diplomas-viewport { padding: 10px 0; }
    .diploma-card { width: 140px; height: 187px; border-radius: 10px; }
    .diploma-caption { font-size: 0.72em; padding: 8px 10px 6px; line-height: 1.2; }
    .diploma-zoom { width: 26px; height: 26px; font-size: 0.7em; top: 6px; right: 6px; }

    .diploma-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
        padding: 0 0 2px 0;
    }
    .diploma-arrow::before,
    .diploma-arrow::after { inset: -4px; border-width: 2px; }

    .diplomas-editor { padding: 14px; border-radius: 16px; }
    .diplomas-admin-list { gap: 8px; margin-top: 12px; }
    .diploma-edit-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 10px;
    }
    .diploma-edit-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 6px;
    }
    .diploma-edit-actions button {
        width: 36px;
        height: 36px;
    }
}