/* ============================================
   3D Model Page - Specific Styles
   Teal / Cyan / Amber Architectural Theme
   ============================================ */

/* ============ Theme Override Variables ============ */
.td-model-page {
    --comp-primary: #26c6da;
    --comp-secondary: #0097a7;
    --comp-accent: #ff9800;
    --comp-danger: #EF4444;
    --comp-gradient: linear-gradient(135deg, #26c6da, #0097a7);
    --comp-gradient-neon: linear-gradient(135deg, #26c6da, #ff9800);
}

/* ============ Loading Screen - 3D Cube Animation ============ */
.td-loader {
    animation: tdCubeFloat 2.5s ease-in-out infinite;
}

@keyframes tdCubeFloat {
    0%, 100% { transform: translateY(0) rotateZ(0deg); }
    25% { transform: translateY(-10px) rotateZ(1deg); }
    50% { transform: translateY(3px) rotateZ(-1deg); }
    75% { transform: translateY(-6px) rotateZ(0.5deg); }
}

.td-loader-svg {
    filter: drop-shadow(0 0 30px rgba(38, 198, 218, 0.4));
}

/* Loader Text & Progress */
.td-model-page .loader-container {
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.td-model-page .loader-title {
    color: #26c6da;
}

.td-model-page .loader-progress {
    background: linear-gradient(90deg, #26c6da, #ff9800);
}

/* ============ Hero - Blueprint Background ============ */
.td-blueprint-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 30%, rgba(38, 198, 218, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 20% 60%, rgba(0, 151, 167, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 40%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
}

/* Blueprint grid lines */
.td-blueprint-bg::before,
.td-blueprint-bg::after {
    content: '';
    position: absolute;
    inset: 0;
}

.td-blueprint-bg::before {
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(38, 198, 218, 0.03) 0px,
            rgba(38, 198, 218, 0.03) 1px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(38, 198, 218, 0.03) 0px,
            rgba(38, 198, 218, 0.03) 1px,
            transparent 1px,
            transparent 40px
        );
    animation: tdBlueprintPulse 8s ease-in-out infinite alternate;
}

.td-blueprint-bg::after {
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(38, 198, 218, 0.015) 0px,
            rgba(38, 198, 218, 0.015) 1px,
            transparent 1px,
            transparent 10px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(38, 198, 218, 0.015) 0px,
            rgba(38, 198, 218, 0.015) 1px,
            transparent 1px,
            transparent 10px
        );
}

@keyframes tdBlueprintPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Hero Orbs - Architectural Theme */
.td-model-page .orb-1 {
    background: rgba(38, 198, 218, 0.25);
}

.td-model-page .orb-2 {
    background: rgba(0, 151, 167, 0.2);
}

.td-model-page .orb-3 {
    background: rgba(255, 152, 0, 0.18);
}

/* Hero Image Frame */
.td-model-page .corner {
    border-color: var(--comp-primary);
}

.td-model-page .image-overlay {
    background: linear-gradient(
        135deg,
        rgba(38, 198, 218, 0.2) 0%,
        transparent 50%,
        rgba(255, 152, 0, 0.2) 100%
    );
}

/* ============ Competition Format Diagram ============ */
.td-format-wrapper {
    margin-top: 20px;
}

.td-format-card {
    padding: 40px;
    text-align: center;
    overflow-x: auto;
}

.td-format-svg {
    max-width: 100%;
    height: auto;
}

/* ============ Rules Grid ============ */
.td-rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.td-rule-card {
    text-align: center;
    padding: 30px 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.td-rule-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--comp-gradient-neon);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.td-rule-card:hover {
    transform: translateY(-8px);
    border-color: var(--comp-primary);
    box-shadow: 0 20px 50px rgba(38, 198, 218, 0.15);
}

.td-rule-card:hover::before {
    opacity: 1;
}

.td-rule-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.td-rule-card:hover .td-rule-icon {
    transform: scale(1.1);
}

.td-rule-icon svg {
    width: 32px;
    height: 32px;
}

/* Rule icon variants */
.td-rule-icon--cad {
    background: linear-gradient(135deg, rgba(38, 198, 218, 0.2), rgba(38, 198, 218, 0.08));
}
.td-rule-icon--cad svg { stroke: #26c6da; }

.td-rule-icon--time {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.08));
}
.td-rule-icon--time svg { stroke: #ff9800; }

.td-rule-icon--file {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.08));
}
.td-rule-icon--file svg { stroke: #4caf50; }

.td-rule-icon--ban {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
}
.td-rule-icon--ban svg { stroke: #EF4444; }

.td-rule-icon--judge {
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.2), rgba(0, 151, 167, 0.08));
}
.td-rule-icon--judge svg { stroke: #0097a7; }

.td-rule-icon--laptop {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.08));
}
.td-rule-icon--laptop svg { stroke: #9C27B0; }

.td-rule-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.td-rule-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

/* ============ Scoring Section ============ */
.td-scoring-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.td-scoring-card {
    text-align: center;
    padding: 35px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.td-scoring-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.td-scoring-card--speed::before { background: linear-gradient(90deg, #26c6da, #0097a7); }
.td-scoring-card--accuracy::before { background: linear-gradient(90deg, #ff9800, #f57c00); }
.td-scoring-card--quality::before { background: linear-gradient(90deg, #4caf50, #388e3c); }

.td-scoring-card:hover {
    transform: translateY(-5px);
    border-color: rgba(38, 198, 218, 0.35);
    box-shadow: 0 20px 50px rgba(38, 198, 218, 0.12);
}

.td-scoring-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

.td-scoring-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.td-scoring-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ============ Flow Diagram ============ */
.td-flow-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px 40px;
    flex-wrap: wrap;
}

.td-flow-step {
    display: flex;
    align-items: center;
    gap: 14px;
}

.td-flow-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    background: rgba(38, 198, 218, 0.1);
    border: 2px solid rgba(38, 198, 218, 0.3);
    flex-shrink: 0;
}

.td-flow-number--highlight {
    background: rgba(38, 198, 218, 0.15);
    border-color: rgba(38, 198, 218, 0.5);
    color: #26c6da;
    box-shadow: 0 0 20px rgba(38, 198, 218, 0.2);
}

.td-flow-number--gold {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
    color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.td-flow-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.td-flow-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.td-flow-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.td-flow-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(38, 198, 218, 0.4);
    flex-shrink: 0;
}

.td-flow-arrow svg {
    width: 20px;
    height: 20px;
}

/* ============ Prohibited Actions ============ */
.td-prohibit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.td-prohibit-card {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.td-prohibit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #EF4444, #DC2626);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.td-prohibit-card:hover {
    transform: translateY(-5px);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 20px 50px rgba(239, 68, 68, 0.1);
}

.td-prohibit-card:hover::before {
    opacity: 1;
}

.td-prohibit-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #EF4444;
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.td-prohibit-card:hover .td-prohibit-icon {
    transform: scale(1.1);
}

.td-prohibit-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.td-prohibit-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

/* ============ Prizes Section ============ */
.td-prizes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.td-prize-card {
    text-align: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.td-prize-card:hover {
    transform: translateY(-8px);
}

.td-prize-card-gold {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08), rgba(17, 24, 39, 0.8));
}

.td-prize-card-gold:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.15);
}

.td-prize-card-silver {
    border-color: rgba(192, 192, 192, 0.3);
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.06), rgba(17, 24, 39, 0.8));
}

.td-prize-card-silver:hover {
    border-color: rgba(192, 192, 192, 0.5);
    box-shadow: 0 20px 50px rgba(192, 192, 192, 0.1);
}

.td-prize-card-bronze {
    border-color: rgba(205, 127, 50, 0.3);
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.06), rgba(17, 24, 39, 0.8));
}

.td-prize-card-bronze:hover {
    border-color: rgba(205, 127, 50, 0.5);
    box-shadow: 0 20px 50px rgba(205, 127, 50, 0.1);
}

.td-prize-medal {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.td-prize-place {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.td-prize-card-gold .td-prize-place { color: #FFD700; }
.td-prize-card-silver .td-prize-place { color: #C0C0C0; }
.td-prize-card-bronze .td-prize-place { color: #CD7F32; }

.td-prize-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Prizes Note */
.td-prizes-note {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 30px;
    margin-top: 32px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.td-prizes-note i {
    font-size: 1.4rem;
    color: #ff9800;
    flex-shrink: 0;
    margin-top: 2px;
}

.td-prizes-note p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

/* ============ Gallery Grid - 3 Images ============ */
.td-gallery-grid {
    grid-template-columns: 1.5fr 1fr 1fr !important;
    grid-template-rows: 350px !important;
}

.td-gallery-grid .gallery-item-large {
    grid-column: 1;
    grid-row: 1;
}

.td-gallery-grid .gallery-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.td-gallery-grid .gallery-item:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

/* ============ Section Tag Override ============ */
.td-model-page .section-tag {
    background: rgba(38, 198, 218, 0.1);
    border-color: rgba(38, 198, 218, 0.3);
    color: var(--comp-primary);
}

/* ============ Badge Override ============ */
.td-model-page .badge-category {
    background: rgba(38, 198, 218, 0.15);
    border-color: rgba(38, 198, 218, 0.4);
    color: var(--comp-primary);
}

/* ============ Stat Item Override ============ */
.td-model-page .stat-item:hover {
    border-color: var(--comp-primary);
    box-shadow: 0 10px 30px rgba(38, 198, 218, 0.15);
}

.td-model-page .stat-icon {
    background: rgba(38, 198, 218, 0.1);
}

.td-model-page .stat-icon svg {
    stroke: var(--comp-primary);
}

/* ============ Goal Card Override ============ */
.td-model-page .goal-card:hover {
    border-color: var(--comp-primary);
}

.td-model-page .goal-number {
    color: rgba(38, 198, 218, 0.15);
}

.td-model-page .goal-icon {
    background: rgba(38, 198, 218, 0.1);
}

.td-model-page .goal-icon svg {
    stroke: var(--comp-primary);
}

/* ============ Info Card Override ============ */
.td-model-page .info-card h4 {
    color: var(--comp-primary);
}

.td-model-page .participant-list li i {
    color: var(--comp-primary);
}

/* ============ CTA Override ============ */
.td-model-page .cta-glow {
    background: radial-gradient(circle, rgba(38, 198, 218, 0.2), transparent 70%);
}

/* ============ Card Glass Hover ============ */
.td-model-page .card-glass:hover {
    border-color: rgba(38, 198, 218, 0.3);
}

/* ============ Button Glow Override ============ */
.td-model-page .btn-glow::before {
    background: var(--comp-gradient);
}

/* ============ Grid Floor Override ============ */
.td-model-page .grid-floor {
    background:
        linear-gradient(transparent, rgba(38, 198, 218, 0.1)),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            rgba(38, 198, 218, 0.08) 49px,
            rgba(38, 198, 218, 0.08) 50px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            rgba(38, 198, 218, 0.08) 49px,
            rgba(38, 198, 218, 0.08) 50px
        );
    transform: perspective(500px) rotateX(60deg);
    transform-origin: bottom;
}

/* ============ Scroll Indicator ============ */
.td-model-page .wheel {
    background: var(--comp-primary);
}

/* ============ Responsive ============ */
@media (max-width: 1200px) {
    .td-rules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .td-prohibit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .td-rules-grid {
        grid-template-columns: 1fr;
    }

    .td-scoring-grid {
        grid-template-columns: 1fr;
    }

    .td-prohibit-grid {
        grid-template-columns: 1fr;
    }

    .td-gallery-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }

    .td-gallery-grid .gallery-item-large {
        grid-column: 1;
        grid-row: 1;
    }

    .td-gallery-grid .gallery-item:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .td-gallery-grid .gallery-item:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    .td-prizes-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .td-flow-card {
        flex-direction: column;
        gap: 16px;
        padding: 24px;
    }

    .td-flow-arrow {
        transform: rotate(90deg);
    }

    .td-flow-step {
        width: 100%;
        justify-content: center;
    }

    .td-format-card {
        padding: 20px 10px;
    }
}

@media (max-width: 768px) {
    .td-rules-grid {
        gap: 16px;
    }

    .td-rule-card {
        padding: 24px 16px;
    }

    .td-scoring-card {
        padding: 24px 16px;
    }

    .td-prohibit-card {
        padding: 24px 16px;
    }

    .td-gallery-grid .gallery-item {
        height: 200px;
    }

    .td-format-card {
        padding: 16px 8px;
    }

    .td-prizes-note {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .td-gallery-grid .gallery-item {
        height: 180px;
    }

    .td-flow-number {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }

    .td-prizes-grid {
        max-width: 100%;
    }

    .td-prize-card {
        padding: 30px 16px;
    }
}
