/* =========================================
   MODAL & LIGHTBOX
   ========================================= */

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.97);
    z-index: 11000;
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: block;
}

/* Two-column layout */
.modal-layout {
    display: flex;
    height: 100vh;
}

/* Left: scrollable project content */
.modal-main-col {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.modal-main-col.no-scroll {
    overflow-y: hidden;
}

/* Right: sticky sidebar with project info */
.modal-sidebar-col {
    width: 380px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    background: rgba(255,255,255,0.03);
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-close {
    position: fixed;
    top: 1.5rem; right: 1.5rem;
    width: 44px; height: 44px;
    background: var(--accent);
    color: var(--white);
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    z-index: 11001;
    transition: transform var(--transition-base), background var(--transition-base), color var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    transform: rotate(90deg);
    background: var(--white);
    color: var(--accent);
}

.modal-logo {
    width: 68px;
    height: auto;
    margin-bottom: 1rem;
}

#modalCategory {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.modal-sidebar-col h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.modal-tag {
    padding: 0.3rem 0.7rem;
    background: rgba(255,51,102,0.08);
    color: var(--accent);
    border: 1px solid rgba(255,51,102,0.3);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.modal-tag:hover {
    background: rgba(255,51,102,0.18);
    border-color: rgba(255,51,102,0.6);
}

.modal-side-desc {
    color: #999;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 1rem;
}

/* Poster image — centered and fills the main column */
.modal-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ne zoom-in — custom kurzor už stav „ZOOM" kreslí sám (.cursor-zoom).
       Nativní lupa by se vykreslila přes něj. */
    cursor: none !important;
    min-height: calc(100vh - 6rem);
}

.modal-image img {
    max-height: calc(100vh - 8rem);
    max-width: 100%;
    width: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-description {
    color: var(--white);
    font-size: 1.1rem;
    line-height: 1.8;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Project Detail */
.project-detail-container {
    color: var(--white);
    max-width: 1000px;
    margin: 0 auto;
}

.pd-section {
    margin-bottom: 5rem;
}

.pd-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--white);
    letter-spacing: -0.02em;
}

.pd-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.pd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.pd-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.pd-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform var(--transition-base);
    cursor: none !important;
}

.pd-image:hover {
    transform: scale(1.02);
}

.pd-caption {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.5rem;
    display: block;
    text-align: center;
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--white);
    color: var(--black);
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    border-radius: 8px;
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
    margin-top: 1rem;
}

.pd-btn:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
}

.pd-next-btn {
    display: block;
    width: 100%;
    padding: 2rem;
    background: rgba(255,255,255,0.05);
    color: var(--white);
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    text-transform: uppercase;
    margin-top: 4rem;
    transition: background var(--transition-base), border-color var(--transition-base);
    border-radius: 12px;
    letter-spacing: -0.02em;
}

.pd-next-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Comparison */
.comparison-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.comp-box {
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.comp-box.old { background: #e0e0e0; }
.comp-box.new { background: #ffffff; box-shadow: 0 0 30px rgba(255,255,255,0.1); position: relative; }
.bg-white { background-color: #fff; padding: 2rem; border-radius: 12px; }

.comp-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: #666;
    font-weight: 700;
}

.rotate-left {
    transform: rotate(-90deg) !important;
    width: 100% !important;
    margin: 2rem auto;
    transform-origin: center center;
    transition: none !important;
}

.rotate-left:hover {
    transform: rotate(-90deg) scale(1.02) !important;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 12500;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.lightbox img {
    max-width: 85%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.lb-arrow {
    pointer-events: auto;
    background: rgba(255,255,255,0.1);
    color: white;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background var(--transition-base), transform var(--transition-base);
    user-select: none;
    border: none;
}

.lb-arrow:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.lb-counter {
    position: absolute;
    bottom: 2rem;
    color: #888;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.fade-change {
    opacity: 0;
    transform: scale(0.95);
}

/* ---- Skeleton loader ---- */
.modal-loading {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    padding: 1rem 0 3rem;
}
.modal-loading.hidden { display: none; }

.sk-block {
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.09) 40%,
        rgba(255,255,255,0.04) 80%
    );
    background-size: 300% 100%;
    animation: skShimmer 1.6s ease-in-out infinite;
}
.sk-hero   { height: clamp(260px, 40vh, 480px); }
.sk-text-lg { height: 24px; width: 55%; }
.sk-text-sm { height: 18px; width: 38%; }
.sk-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.sk-duo .sk-block { height: 200px; }

@keyframes skShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--black);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    z-index: 15000;
    animation: toastIn 0.3s ease;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.toast.success { border-color: #00ff00; }
.toast.error { border-color: var(--accent); }
.toast.removing { animation: toastOut 0.3s ease forwards; }
