/* ============================================
   Romantic Website Styles
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Romantic Color Palette */
    --primary-pink: #ffb3d9;
    --soft-pink: #ffe6f2;
    --light-pink: #fff0f8;
    --rose: #ff9ec5;
    --lavender: #e6d9f2;
    --peach: #ffd9cc;
    --cream: #fff8f0;
    --white: #ffffff;
    --text-dark: #4a4a4a;
    --text-light: #6b6b6b;
    --shadow-soft: rgba(255, 182, 193, 0.3);
    --shadow-medium: rgba(255, 182, 193, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-pink) 0%, var(--lavender) 50%, var(--cream) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

/* Code Entry Screen */
.code-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--lavender) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.code-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.code-container {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-soft);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.code-title {
    font-size: 2rem;
    color: var(--rose);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.code-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.code-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--primary-pink);
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: var(--light-pink);
    color: var(--text-dark);
}

.code-input:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px var(--shadow-medium);
    background: var(--white);
}

.code-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--rose) 0%, var(--primary-pink) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.code-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-soft);
}

.code-button:active {
    transform: translateY(0);
}

.error-message {
    color: #ff6b6b;
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Main Content */
.main-content {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.main-content.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--lavender) 100%);
    margin-bottom: 2rem;
}

.main-title {
    font-size: 3rem;
    color: var(--rose);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px var(--shadow-medium);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--rose);
    margin-bottom: 2rem;
    font-weight: 600;
}

.section-title2 {
    text-align: center;
    font-size: 1.7rem;
    color: var(--rose);
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Timer Section */
.timer-section {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.timer-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.timer-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-box {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-soft);
    text-align: center;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timer-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.timer-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--rose);
    margin-bottom: 0.5rem;
}

.timer-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Audio Section */
.audio-section {
    padding: 1.5rem 1rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: right;
    direction: rtl;
}

.audio-container {
    background: var(--white);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 20px var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
}

.audio-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--shadow-medium);
}

.audio-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
}

.audio-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.audio-play-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--rose) 0%, var(--primary-pink) 100%);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 158, 197, 0.4);
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.audio-play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 158, 197, 0.5);
}

.audio-play-button:active {
    transform: scale(0.95);
}

.audio-play-button.playing {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--rose) 100%);
}

.play-icon {
    font-size: 1.2rem;
    margin-right: 1px;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.audio-play-button.playing .play-icon {
    opacity: 0;
}

.audio-play-button.playing::after {
    content: "❚❚";
    font-size: 1rem;
    position: absolute;
    color: var(--white);
}

#romanticAudio {
    display: none;
}

/* Text Section */
.text-section {
    padding: 3rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.text-block {
    background: var(--white);
    padding: 1rem .6rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 20px var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.text-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.text-title {
    font-size: 1.5rem;
    color: var(--rose);
    margin-bottom: 1rem;
    font-weight: 600;
}

.text-content {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.5;
    text-align: justify;
    margin: 0;
    flex: 1;
}

.text-block svg {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

/* Flip Cards Section */
.cards-section {
    padding: 3rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    overflow-y: hidden;
}

.flip-card {
    background-color: transparent;
    width: 280px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.flip-card-front {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--lavender) 100%);
    color: var(--white);
}

.flip-card-back {
    background: var(--white);
    color: var(--text-dark);
    transform: rotateY(180deg);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 1.3rem;
    line-height: 1.9;
    text-align: justify;
}

/* Image Section */
.image-section {
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.image-item {
    margin-bottom: 3rem;
    text-align: center;
}

.romantic-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow-soft);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.romantic-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow-medium);
}

.image-caption {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    font-style: normal;
    padding: 0 1rem;
}

/* Widget Section */
.widget-section {
    padding: 3rem 1rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.widget-button {
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, var(--rose) 0%, var(--primary-pink) 100%);
    color: var(--white);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px var(--shadow-medium);
}

.widget-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-soft);
}

.widget-button:active {
    transform: translateY(-1px);
}

.widget {
    margin-top: 2rem;
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 25px var(--shadow-soft);
    transition: all 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
    overflow: hidden;
}

.widget.hidden {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
    padding: 0 2.5rem;
    margin: 0;
}

.widget-content {
    text-align: center;
}

.widget-title {
    font-size: 1.4rem;
    color: var(--rose);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.widget-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.close-button {
    padding: 0.8rem 2rem;
    background: var(--primary-pink);
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: var(--rose);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .timer-box {
        min-width: 100px;
        padding: 1rem 1.5rem;
    }

    .timer-value {
        font-size: 2rem;
    }

    .flip-card {
        width: 200px;
        height: 200px;
        flex-shrink: 0;
    }

    .flip-card-front,
    .flip-card-back {
        padding: 1.2rem;
    }

    .flip-card-back {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .flip-card-back::-webkit-scrollbar {
        width: 4px;
    }

    .flip-card-back::-webkit-scrollbar-thumb {
        background: var(--primary-pink);
        border-radius: 10px;
    }

    .cards-container {
        gap: 1rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 1rem;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scroll-padding: 1rem;
    }

    .cards-section {
        padding: 3rem 0.5rem;
        overflow-x: hidden;
    }

    .card-icon {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    .cards-container::-webkit-scrollbar {
        height: 6px;
    }

    .cards-container::-webkit-scrollbar-track {
        background: var(--light-pink);
        border-radius: 10px;
    }

    .cards-container::-webkit-scrollbar-thumb {
        background: var(--primary-pink);
        border-radius: 10px;
    }

    .romantic-image {
        height: 300px;
    }

    .text-content,
    .widget-text {
        font-size: 1rem;
    }

    .audio-container {
        padding: 0.8rem 1.2rem;
    }

    .audio-play-button {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .code-container {
        padding: 2rem 1.5rem;
    }

    .code-title {
        font-size: 1.5rem;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .timer-row {
        gap: 0.5rem;
    }

    .timer-box {
        min-width: 90px;
        padding: 1rem;
    }

    .timer-value {
        font-size: 1.5rem;
    }

    .timer-label {
        font-size: 0.75rem;
    }

    .flip-card {
        width: 160px;
        height: 160px;
        flex-shrink: 0;
    }

    .flip-card-front,
    .flip-card-back {
        padding: 0.8rem;
        overflow: hidden;
    }

    .flip-card-back {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .flip-card-back::-webkit-scrollbar {
        width: 3px;
    }

    .flip-card-back::-webkit-scrollbar-thumb {
        background: var(--primary-pink);
        border-radius: 10px;
    }

    .cards-container {
        gap: 0.75rem;
        overflow-y: hidden;
        padding: 0.5rem 1rem;
        justify-content: flex-start;
    }

    .cards-section {
        padding: 3rem 0.5rem;
        overflow-x: hidden;
    }

    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .card-text {
        font-size: 0.95rem;
        line-height: 1.6;
        text-align: justify;
    }

    .romantic-image {
        height: auto;
    }

    .widget {
        padding: 1.5rem;
    }

    .audio-container {
        padding: 0.8rem 1rem;
    }

    .audio-text {
        font-size: 1rem;
    }

    .audio-play-button {
        width: 42px;
        height: 42px;
    }

    .play-icon {
        font-size: 1rem;
    }
}

/* LTR Support */
[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .text-content,
[dir="ltr"] .card-text,
[dir="ltr"] .widget-text {
    text-align: left;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}