/* ========================================
   MorseCode Design — Custom Styles
   ======================================== */

/* Local Google Fonts (DSGVO-konform) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/space-mono-v17-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Space Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/space-mono-v17-latin-700.woff2') format('woff2');
}

:root {
    --morse-color: #c8a44e;
    --morse-glow: rgba(200, 164, 78, 0.3);
    --frame-color: #2a2216;
    --frame-inner: #1a1610;
    --frame-highlight: #3d3020;
}

/* Typography */
.font-mono {
    font-family: 'Space Mono', monospace !important;
}

.text-morse {
    color: var(--morse-color) !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
}

/* Navbar */
.navbar-brand .text-morse {
    font-size: 0.7em;
    opacity: 0.6;
}

/* ========================================
   Hero Section with Unsplash Background
   ======================================== */
.hero-section {
    background:
        linear-gradient(to bottom, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.6) 50%, rgba(10, 10, 10, 0.95) 100%),
        url('../img/hero-bg.jpg') center center / cover no-repeat;
}

.min-vh-75 {
    min-height: 75vh;
}

.morse-bg-animation {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 20px,
            rgba(200, 164, 78, 0.03) 20px,
            rgba(200, 164, 78, 0.03) 21px
        );
    animation: scrollBg 20s linear infinite;
}

@keyframes scrollBg {
    from { transform: translateX(0); }
    to { transform: translateX(21px); }
}

/* ========================================
   Frame System — Dynamic per-artwork frames
   ======================================== */

/* Card image container — clip frame overflow */
.artwork-card .card-img-top {
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

/* Showcase wrapper — white background behind frame (card) */
.artwork-showcase-card {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Base frame (card size) */
.frame-card {
    position: relative;
    padding: 8px;
    border-radius: 3px;
    transition: box-shadow 0.3s ease;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-card img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Showcase wrapper — white background behind frame */
.artwork-showcase {
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base frame (large, QR page) */
.frame-lg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 4px;
    transition: box-shadow 0.3s ease;
    line-height: 0;
}

.frame-lg img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---- Frame Colors ---- */

/* Black frame (wie echtes Produkt) */
.frame-black {
    background: #111;
    border: 5px solid #1a1a1a;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.5);
}
.artwork-card:hover .frame-black { box-shadow: 0 10px 40px rgba(0,0,0,0.6); }

/* White frame */
.frame-white {
    background: #f2f2f2;
    border: 5px solid #e8e8e8;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.artwork-card:hover .frame-white { box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

/* Oak / Eiche */
.frame-oak {
    background: linear-gradient(145deg, #8B7355, #6B5335);
    border: 5px solid #9B8365;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.artwork-card:hover .frame-oak { box-shadow: 0 8px 35px rgba(139,115,85,0.35); }

/* Light Oak / Helles Holz */
.frame-light-oak {
    background: linear-gradient(145deg, #D4B896, #B8956A);
    border: 5px solid #E0C9A6;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,245,220,0.4), inset 0 -1px 0 rgba(120,80,40,0.25);
}
.artwork-card:hover .frame-light-oak { box-shadow: 0 8px 35px rgba(184,149,106,0.35); }

/* Gold */
.frame-gold {
    background: linear-gradient(145deg, #b8962e, #8a6d1f);
    border: 5px solid #c8a44e;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,200,0.25), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.artwork-card:hover .frame-gold { box-shadow: 0 8px 35px rgba(200,164,78,0.35); }

/* Rose (zartrosa) */
.frame-rose {
    background: linear-gradient(145deg, #D4687A, #B85568);
    border: 5px solid #E07A8C;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,200,210,0.2), inset 0 -1px 0 rgba(0,0,0,0.2);
}
.artwork-card:hover .frame-rose { box-shadow: 0 8px 35px rgba(212,104,122,0.3); }

/* Plum (dunkles Lila) */
.frame-plum {
    background: linear-gradient(145deg, #6B3FA0, #522F80);
    border: 5px solid #7E4FBA;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(200,180,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.artwork-card:hover .frame-plum { box-shadow: 0 8px 35px rgba(107,63,160,0.35); }

/* Lavender (helles Lila) */
.frame-lavender {
    background: linear-gradient(145deg, #9B8EC4, #806FAF);
    border: 5px solid #AEA0D4;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3), inset 0 1px 0 rgba(220,210,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.15);
}
.artwork-card:hover .frame-lavender { box-shadow: 0 8px 35px rgba(155,142,196,0.35); }

/* Navy (dunkles Blau) */
.frame-navy {
    background: linear-gradient(145deg, #2C3E6B, #1E2D52);
    border: 5px solid #3A4F7E;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(150,180,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.artwork-card:hover .frame-navy { box-shadow: 0 8px 35px rgba(44,62,107,0.35); }

/* Teal (türkis/petrol) */
.frame-teal {
    background: linear-gradient(145deg, #1A7A6D, #135E54);
    border: 5px solid #229080;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(150,255,230,0.1), inset 0 -1px 0 rgba(0,0,0,0.3);
}
.artwork-card:hover .frame-teal { box-shadow: 0 8px 35px rgba(26,122,109,0.35); }

/* Mat Cream (Passepartout-Stil) */
.frame-mat-cream {
    background: linear-gradient(145deg, #3d3020, #1a1610);
    border: 5px solid #4a3d28;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5), inset 0 1px 0 rgba(200,164,78,0.15);
}
.frame-mat-cream img {
    padding: 12px;
    background: linear-gradient(135deg, #f5f0e8, #e8e0d0);
    border: 1px solid rgba(0,0,0,0.1);
}
.frame-card.frame-mat-cream img { padding: 8px; }
.artwork-card:hover .frame-mat-cream { box-shadow: 0 8px 35px rgba(200,164,78,0.25); }

/* Sold Ribbon */
.sold-ribbon {
    position: absolute;
    top: 20px;
    right: -10px;
    background: linear-gradient(135deg, #c0392b, #8b1a1a);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    padding: 8px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
    transform: rotate(8deg);
    text-transform: uppercase;
    pointer-events: none;
}
.sold-ribbon::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid #5a0f0f;
    border-bottom: 8px solid transparent;
}

.artwork-sold .artwork-showcase-card {
    opacity: 0.75;
    filter: grayscale(10%);
    transition: opacity 0.3s, filter 0.3s;
}
.artwork-sold:hover .artwork-showcase-card {
    opacity: 0.9;
    filter: grayscale(0);
}

/* None (kein Rahmen — für farbige Hintergründe) */
.frame-none {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-radius: 6px;
    overflow: hidden;
}
.frame-none img { border-radius: 4px; }
.artwork-card:hover .frame-none { box-shadow: 0 8px 35px rgba(0,0,0,0.5); }

/* ========================================
   Artwork Cards
   ======================================== */
.artwork-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.artwork-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(200, 164, 78, 0.15);
}

/* ========================================
   Morse Visual
   ======================================== */
.morse-visual {
    padding: 0.5rem 0;
}

.morse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--morse-color);
    display: inline-block;
    box-shadow: 0 0 6px var(--morse-glow);
}

.morse-dash {
    width: 30px;
    height: 10px;
    border-radius: 5px;
    background: var(--morse-color);
    display: inline-block;
    box-shadow: 0 0 6px var(--morse-glow);
}

.morse-space {
    width: 15px;
    display: inline-block;
}

/* Decoded Box */
.decoded-box {
    background: rgba(200, 164, 78, 0.08);
    border: 1px solid rgba(200, 164, 78, 0.2);
}

/* Step Icons */
.step-icon {
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    border: 2px solid var(--morse-color);
    margin: 0 auto;
}

/* Morse Alphabet Grid */
.morse-alphabet .bg-dark {
    border: 1px solid rgba(108, 117, 125, 0.3);
    transition: border-color 0.2s ease;
}

.morse-alphabet .bg-dark:hover {
    border-color: var(--morse-color);
}

/* ========================================
   Legal Content
   ======================================== */
.legal-content h4 {
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-content h5 {
    color: #ccc;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-content p,
.legal-content li {
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .decoded-box .display-4 {
        font-size: 2rem;
    }

    .frame-card, .frame-lg {
        padding: 4px;
    }

    .frame-mat-cream img {
        padding: 6px;
    }
}

/* ========================================
   Certificate of Authenticity
   ======================================== */
.certificate-wrapper {
    padding: 2rem 0;
}

.certificate {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    color: #1a1a1a;
}

.cert-border {
    border: 3px solid var(--morse-color);
    padding: 6px;
}

.cert-inner {
    border: 1px solid #d4b86a;
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: calc(297mm - 40px);
}

.cert-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.cert-bottom {
    margin-top: auto;
}

.cert-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cert-logo {
    margin-bottom: 0.5rem;
    text-align: center;
    line-height: 1;
}

.cert-logo-brand {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.08em;
}

.cert-title {
    font-family: 'Inter', serif;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0;
}

.cert-subtitle {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-top: 0.3rem;
}

.cert-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--morse-color), transparent);
    margin: 1.5rem 0;
}

.cert-number {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.cert-artwork-section {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.cert-artwork-image {
    flex: 0 0 260px;
    background: #fff;
    border-radius: 4px;
}

.cert-artwork-image .frame-card {
    padding: 8px;
    height: auto;
}

.cert-artwork-image img {
    display: block;
    width: 100%;
    max-height: none;
    background: #fff;
}

.cert-artwork-details {
    flex: 1;
    padding-left: 1rem;
}

.cert-field {
    margin-bottom: 0.9rem;
}

.cert-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.cert-value {
    font-size: 1rem;
    color: #1a1a1a;
}

.cert-decoded {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--morse-color);
}

.cert-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #888;
    vertical-align: middle;
    margin-right: 0.25rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.cert-owner-section {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.cert-owner-name {
    font-size: 1.3rem;
    font-weight: 600;
}

.cert-address {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.5;
}

.cert-date-field {
    margin-bottom: 0;
    padding-left: 2rem;
}

.cert-statement {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.7;
    text-align: center;
    font-style: italic;
}

.cert-verification {
    margin-top: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: #f8f5ed;
    border: 1px solid #e8e0c8;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cert-verification-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cert-verification-label {
    color: #666;
    min-width: 130px;
    flex-shrink: 0;
}

.cert-verification-value {
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: 0.03em;
    word-break: break-all;
}

.cert-signature-section {
    text-align: center;
    margin-top: 2rem;
}

.cert-signature-line {
    width: 200px;
    height: 1px;
    background: #333;
    margin: 0 auto 0.5rem;
}

.cert-signature-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.cert-signature-title {
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.05em;
}

.cert-footer-morse {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #ccc;
    letter-spacing: 0.2em;
}

/* Mobile Styles — kompaktere Darstellung, vertikales Layout */
@media (max-width: 767.98px) {
    .certificate-wrapper { padding: 0.5rem 0; }

    .certificate { max-width: 100%; }

    .cert-border { padding: 4px; }

    .cert-inner {
        padding: 1.25rem 1rem 1rem;
        min-height: auto;
    }

    .cert-main {
        gap: 0.75rem;
    }

    .cert-header { margin-bottom: 1rem; }
    .cert-logo-brand { font-size: 0.8rem; }
    .cert-title { font-size: 1.25rem; letter-spacing: 0.08em; }
    .cert-subtitle { font-size: 0.78rem; }
    .cert-divider { margin: 1rem 0; }
    .cert-number { font-size: 0.75rem; margin-bottom: 1rem; word-break: break-all; padding: 0 0.5rem; }

    /* Artwork-Section vertikal stapeln statt nebeneinander */
    .cert-artwork-section {
        flex-direction: column;
        gap: 1.25rem;
        padding: 0;
        margin-bottom: 1rem;
    }

    .cert-artwork-image {
        flex: 0 0 auto;
        width: 70%;
        max-width: 240px;
        margin: 0 auto;
    }

    .cert-artwork-details {
        padding-left: 0;
        width: 100%;
    }

    .cert-field { margin-bottom: 0.65rem; }
    .cert-decoded { font-size: 1.25rem; }

    .cert-owner-section { padding-left: 0; text-align: center; margin-bottom: 0.75rem; }
    .cert-owner-name { font-size: 1.1rem; }
    .cert-address { font-size: 0.85rem; }
    .cert-date-field { padding-left: 0; text-align: center; }

    .cert-statement { font-size: 0.8rem; padding: 0 0.5rem; }

    /* Verification-Block kompakter, Labels über Werten */
    .cert-verification {
        margin-top: 1rem;
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .cert-verification-row {
        flex-direction: column;
        gap: 0.15rem;
        align-items: flex-start;
        font-size: 0.8rem;
    }

    .cert-verification-label {
        min-width: auto;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .cert-verification-value {
        font-size: 0.85rem;
        word-break: break-all;
    }

    .cert-signature-section { margin-top: 1.25rem; }
    .cert-signature-line { width: 140px; }
    .cert-signature-name { font-size: 0.95rem; }
    .cert-footer-morse { font-size: 0.7rem; margin-top: 1rem; word-break: break-all; padding: 0 0.5rem; }

    /* Action Buttons unter dem Zertifikat */
    .cert-actions { padding: 0 0.5rem; }
    .cert-actions .btn { font-size: 0.9rem; padding: 0.5rem 1rem; }
    .cert-actions form { display: block !important; margin: 0.5rem 0; }
    .cert-actions .me-3,
    .cert-actions .me-2 { margin-right: 0 !important; margin-bottom: 0.5rem; }
}

/* Print Styles — A4 Portrait, single page */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    nav, footer, .no-print {
        display: none !important;
    }

    main {
        padding: 0 !important;
        margin: 0 !important;
    }

    .certificate-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .certificate {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .cert-border {
        border: 3px solid var(--morse-color) !important;
        padding: 6px !important;
        background: #fff !important;
    }

    .cert-inner {
        border: 1px solid #d4b86a !important;
        padding: 1.2cm 1.5cm !important;
        min-height: calc(297mm - 16mm - 30px) !important;
        display: flex;
        flex-direction: column;
    }

    /* Kompaktere Abstände auf Print */
    .cert-header { margin-bottom: 0.4rem !important; }
    .cert-logo { margin-bottom: 0.25rem !important; }
    .cert-logo-brand { font-size: 0.8rem !important; }
    .cert-title { font-size: 1.4rem !important; }
    .cert-subtitle { font-size: 0.8rem !important; }
    .cert-divider { margin: 0.75rem 0 !important; }
    .cert-number { margin-bottom: 0.75rem !important; font-size: 0.8rem !important; }
    .cert-artwork-section { margin-bottom: 0.5rem !important; gap: 1.25rem !important; }
    .cert-artwork-image { flex: 0 0 150px !important; }
    .cert-field { margin-bottom: 0.4rem !important; }
    .cert-owner-section { margin-bottom: 0.5rem !important; }
    .cert-owner-name { font-size: 1.15rem !important; }
    .cert-statement { font-size: 0.78rem !important; margin-bottom: 0 !important; }
    .cert-verification { margin-top: 0.75rem !important; padding: 0.6rem 1rem !important; }
    .cert-verification-row { font-size: 0.78rem !important; }
    .cert-signature-section { margin-top: 1rem !important; }
    .cert-footer-morse { margin-top: 0.75rem !important; }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--morse-color);
    color: #000;
}
