@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&family=Yellowtail&display=swap');

:root {
    --primary-color: #D0A77B; /* var(--warm) from main */
    --bg-color: #2A1F17; /* var(--dark) from main */
    --text-color: #FAF3EA; /* var(--cream) from main */
    --glass-bg: rgba(26, 20, 15, 0.7); /* darker glass */
    --glass-border: rgba(208, 167, 123, 0.3); /* warm border */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(10, 10, 10, 0.5), rgba(10, 10, 10, 0.7)), url('https://kisahkita.space/1.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

h1, h2, h3 {
    font-family: 'Lora', serif;
    font-weight: 500;
}

.wedding-title {
    font-family: 'Yellowtail', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: #fff;
    margin-bottom: 5px;
    text-align: center;
    text-shadow: 0 2px 24px rgba(0,0,0,0.5);
    font-weight: 400;
}

.wedding-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    opacity: 0.8;
}

.glass-panel {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(42, 31, 23, 0.08);
    border-radius: 2rem;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* UI Elements */
.btn {
    background: linear-gradient(135deg, #dfb48b 0%, #c49666 100%);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 69, 49, 0.4);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 69, 49, 0.5);
    background: linear-gradient(135deg, #c49666 0%, #dfb48b 100%);
}

.btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(208, 167, 123, 0.1);
    box-shadow: none;
}

.btn-danger {
    background: #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
    background: #c0392b;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Step 1: Layout Selection */
.layout-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.layout-card {
    background: rgba(26, 20, 15, 0.8);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    width: 120px;
    color: var(--text-color);
}

.layout-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.layout-card.selected {
    border-color: var(--primary-color);
    background: rgba(208, 167, 123, 0.1);
}

.layout-icon {
    width: 60px;
    height: 80px;
    background: #333;
    margin: 0 auto 10px;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    padding: 5px;
    gap: 2px;
}

.layout-icon div {
    background: #aaa;
    border-radius: 2px;
}

/* Icons styling */
.icon-strip div { width: 100%; height: 30%; }
.icon-grid div { width: 48%; height: 48%; }
.icon-single div { width: 100%; height: 100%; }

/* Step 2: Camera (DIPERBARUI UNTUK FULLSCREEN) */
.camera-container {
    position: relative;
    width: 100%;
    height: 65vh; /* Mengambil 65% tinggi layar HP */
    max-height: 800px;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover container, edges will be dimmed by guideline */
}

.countdown-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 8rem;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.flash-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.camera-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Step 3: Result & Form */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#result-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.form-group {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
    background: rgba(0,0,0,0.2);
    color: #fff;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.record-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

.record-indicator .dot {
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#audio-playback {
    margin-top: 10px;
    height: 40px;
    display: none;
}

.hidden {
    display: none !important;
}

/* Gallery specific styles */
.gallery-grid {
    column-count: 1;
    column-gap: 20px;
    width: 100%;
    margin-top: 30px;
}

@media (min-width: 600px) {
    .gallery-grid { column-count: 2; }
}

@media (min-width: 900px) {
    .gallery-grid { column-count: 3; }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.gallery-img {
    width: 100%;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.gallery-info {
    padding: 15px;
}

.gallery-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-family: 'Lora', serif;
    color: var(--primary-color);
}

.gallery-date {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 10px;
}

.audio-player-custom {
    width: 100%;
    height: 36px;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(26, 20, 15, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Back link */
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover {
    text-decoration: underline;
}

/* Modern Camera UI */
.filter-carousel {
    width: 100%;
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 5;
    background: #000;
}
.filter-carousel::-webkit-scrollbar {
    display: none;
}
.filter-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: black;
    font-weight: 600;
}

.camera-ui-bottom {
    width: 100%;
    background: #000;
    padding: 15px 20px;
    z-index: 10;
}

.camera-pills {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ui-pill {
    background: rgba(40,40,40,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.ui-pill:hover {
    background: rgba(60,60,60,0.8);
}
.pill-icon {
    font-size: 1rem;
}

.camera-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.circle-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}
.circle-btn:hover {
    background: rgba(255,255,255,0.2);
}
.small-btn {
    width: 48px;
    height: 48px;
}

.capture-btn-main {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid white;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.capture-btn-inner {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    transition: all 0.1s;
}
.capture-btn-main:active .capture-btn-inner, .capture-btn-main.recording .capture-btn-inner {
    transform: scale(0.85);
    background: #e74c3c;
}

#camera-guideline {
    position: absolute;
    width: 100%;
    height: auto;
    aspect-ratio: 3/4; /* Set to match portrait resolution 480x640 */
    border: 3px dashed rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 5;
    box-sizing: border-box;
}

@media (orientation: landscape) {
    #camera-guideline {
        width: auto;
        height: 100%;
    }
}
