@import 'landing.css';

/* commemerys-styles.css */
:root {
    --bg-dark: #000000;
    --bg-card: rgba(20, 20, 25, 0.7);
    --primary: #f59e0b;
    /* Golden Orange to match Concept 3 */
    --primary-glow: rgba(245, 158, 11, 0.4);
    --secondary: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* --- App Container --- */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.app-container.logged-in {
    opacity: 1;
    pointer-events: all;
}

/* Navbar */
.navbar {
    height: 80px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: var(--glass-border);
    z-index: 50;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-brand img {
    height: 40px;
    width: auto;
}

.nav-brand span {
    background: linear-gradient(to right, white, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Final SVG Logo Styling (Pure and Transparent) */
.logo-wrapper {
    width: 260px;
    height: 260px;
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.landing-logo-img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px var(--primary-glow));
}

/* Landing Logo */
.landing-logo {
    height: 120px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6));
    animation: breath 4s infinite ease-in-out;
}

@keyframes breath {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1.1) drop-shadow(0 0 20px var(--primary-glow));
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.3) drop-shadow(0 0 40px var(--primary-glow));
    }
}

.landing-slogan {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #ffffff, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.landing-quote {
    margin-top: 3rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
    font-weight: 300;
    padding: 0 1.5rem;
}

/* Close Button Styling */
.close-auth-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 101;
    transition: 0.3s;
}

.close-auth-btn:hover {
    transform: rotate(90deg) scale(1.1);
    color: #ef4444;
}

/* Auth Overlay - Glassmorphism */
/* Auth Overlay - Glassmorphism */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    /* Removed backdrop-filter here to fix fixed-position children context */
}

/* Background & Blur Shim */
.auth-overlay::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(18px);
    z-index: -1;
    pointer-events: none;
}

.auth-overlay.active {
    display: flex;
}

.auth-box {
    background: rgba(30, 30, 35, 0.65);
    border: var(--glass-border);
    padding: 3.5rem;
    border-radius: 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    text-align: center;
    display: none;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-box.active {
    display: block;
}

.auth-box h2 {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.auth-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 1.3rem;
    margin-bottom: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    color: white;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    outline: none;
}

.btn {
    width: 100%;
    padding: 1.3rem;
    border: none;
    border-radius: 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 10px 35px -8px var(--primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px -10px var(--primary);
}

/* Sphere View */
.view {
    display: none;
    height: 100%;
    position: relative;
}

.view.active {
    display: block;
}

.sphere-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.sphere-canvas {
    width: 100%;
    height: 100%;
    cursor: move;
}

.sphere-label {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 182, 212, 0.4);
    padding: 0.6rem 1.2rem;
    border-radius: 2.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-node-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.sphere-label:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.18);
    z-index: 100;
    box-shadow: 0 0 35px var(--primary);
}

.sphere-label:hover .delete-node-btn {
    opacity: 1;
    width: auto;
    pointer-events: auto;
    margin-left: 6px;
}

.fab {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), #0ea5e9);
    border: none;
    color: white;
    box-shadow: 0 15px 40px rgba(6, 182, 212, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
    transform: scale(1.15) rotate(90deg);
}

/* Person View */
.back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 200;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.person-header {
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.25) 0%, transparent 75%);
}

.person-name {
    font-size: 3rem;
    font-weight: 700;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 70vh;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-scroll::-webkit-scrollbar {
    display: none;
}

.recording-card {
    background: rgba(30, 30, 35, 0.5);
    border: var(--glass-border);
    border-radius: 28px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(25px);
}

.record-btn {
    margin-top: 2rem;
    width: 100%;
    padding: 1.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.record-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.record-btn.recording {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(18px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(15, 23, 42, 0.9);
    border: var(--glass-border);
    padding: 3.5rem;
    border-radius: 35px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.modal-input {
    width: 85%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 1.2rem;
    color: white;
    margin: 2rem auto;
    display: block;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
}

.modal-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
    width: 90%;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Photos Grid & Lightbox Styling */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
    padding: 1rem 0;
}

.photo-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    border: var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
}

.photo-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.photo-item:hover .photo-delete {
    opacity: 1;
    transform: translateY(0);
}

.photo-delete:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* Lightbox Premium Implementation */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Comprehensive Mobile Adjustments */
@media(max-width: 768px) {
    body {
        font-size: 14px;
    }

    .auth-overlay {
        display: none;
    }

    .auth-overlay.active {
        display: block;
        /* Override flex */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 40px 0 120px 0;
    }

    /* Fixed close button for mobile scanning */
    /* Fixed close button for mobile scanning */
    .close-auth-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        padding: 8px;
        /* Larger touch target */
        backdrop-filter: blur(10px);
        z-index: 10000;
        /* Ensure strictly above everything */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    .navbar {
        height: 70px;
        padding: 0 1rem;
    }

    /* Fix user greeting cut-off on mobile */
    .nav-user {
        font-size: 0.9rem;
        max-width: 50%;
        text-align: right;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .nav-user span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        /* Limit width */
        display: inline-block;
    }

    .logo-wrapper {
        width: 180px;
        height: 180px;
    }

    .landing-slogan {
        font-size: 2rem !important;
        padding: 0 1rem;
    }

    .landing-quote {
        font-size: 0.95rem;
        margin-top: 2rem;
    }

    .auth-box {
        padding: 2.5rem 1.5rem;
        width: 90%;
        border-radius: 25px;
        margin: 60px auto 100px auto;
        /* More top margin for close button, bottom for safe area */
    }

    .auth-box h2 {
        font-size: 1.8rem;
    }

    .person-name {
        font-size: 2.2rem;
        text-align: center;
        padding: 0 1rem;
    }

    .person-header {
        height: 25vh;
    }

    .content-scroll {
        padding: 1.5rem 1rem;
    }

    .recording-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .fab {
        position: fixed;
        /* Use fixed to stay on screen */
        bottom: 2rem;
        right: 2rem;
        width: 60px;
        height: 60px;
        z-index: 900;
        /* Ensure high enough */
        /* Safe area support for iPhone X+ */
        bottom: calc(2rem + env(safe-area-inset-bottom));
        right: calc(2rem + env(safe-area-inset-right));
    }

    .modal-content {
        padding: 2.5rem 1.5rem;
        width: 95%;
    }

    .lightbox-close {
        top: 1rem;
        right: 1.5rem;
        font-size: 2.5rem;
    }
}

/* --- Main Footer Styles --- */
.main-footer {
    position: fixed;
    bottom: 1.5rem;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    z-index: 10000;
    pointer-events: none;
}

.footer-coffee {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    border: var(--glass-border);
    backdrop-filter: blur(12px);
    pointer-events: all;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.footer-coffee:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-2px);
}

.footer-design {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.icon-coffee {
    stroke-width: 1.8;
}

.icon-btc-official {
    width: 20px;
    height: 20px;
    margin: 0 4px;
    filter: drop-shadow(0 0 5px rgba(247, 147, 26, 0.4));
}

.btc-address {
    font-family: monospace;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

@media(max-width: 768px) {
    .main-footer {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
        margin-bottom: 2rem;
        pointer-events: all;
    }

    .landing-logo-img {
        width: 140px;
        height: auto;
        margin: 0 auto;
    }

    .footer-coffee {
        font-size: 0.7rem;
        padding: 0.5rem 0.8rem;
        max-width: 98%;
        flex-wrap: nowrap;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .footer-coffee::-webkit-scrollbar {
        display: none;
    }

    .btc-address {
        font-size: 0.6rem;
    }
}

@media(max-width: 480px) {
    .landing-slogan {
        font-size: 1.8rem !important;
    }

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