/* Base styles with romantic colors */
:root {
    --primary-love: #ff6b8b;
    --secondary-love: #ff8e9e;
    --accent-gold: #ffd166;
    --soft-pink: #ffafcc;
    --deep-love: #ff4d6d;
    --light-romance: #fff0f3;
    --dark-romance: #590d22;
    --paper-cream: #fef7ec;
    --ink-love: #2b2d42;
}

/*[data-theme="dark"] */
body.darkmode {
    --primary-love: #ff8fa3;
    --secondary-love: #ffb3c1;
    --accent-gold: #ffd166;
    --soft-pink: #ffafcc;
    --deep-love: #ff4d6d;
    --light-romance: #1a1423;
    --dark-romance: #ffb3c1;
    --paper-cream: #2d3047;
    --ink-love: #e2f0f7;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	background-color: #fff;
}

body.darkmode {
	background-color: #1c1c1c;
}

.container {
	background-color: #fff;
}
body.darkmode .container {
	background-color: #1c1c1c;
}

/** COMMON PAGE STYLING */
/* THEME TOGGLE */
.theme__choice__container {
        padding: 5px;
        display: flex;
        flex-flow: row nowrap;
        align-items: center;
        justify-content: end;
        width: 100%;
        position: fixed;
        z-index: 999;
}

.theme__choice {
  border: none;
  outline: none;
  background-color: rgba(150, 50, 50, 0.3);
  border-radius: 50%;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.theme__choice:hover {
  transform: scale(1.05);
}

.darkmode .menu__btn img,
.darkmode .close__btn img {
  filter: invert(1);
}

/* NAVIGATION */
.menu__links__section {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1001;
  padding: 2rem 0.8rem 2rem 0.6rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0.3rem;
  /*background-color: rgb(240, 230, 230);
  box-shadow: 0 2px 5px rgba(240, 210, 210, 0.3);*/0
  line-height: 1.5;
  border-bottom: 5px solid red;
  background-color: #f2f2f2;
}

body.darkmode .menu__links__section {
        background-color: #333;
        color: #fff;
        /*border: 1px solid #eee;*/
        box-shadow: 0 2px 5px rgba(240, 210, 210, 0.3);
        border-left: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0.3rem;
}

.menu__links__section > a {
  text-decoration: underline;
  font-size: 1.05rem;
  font-weight: 400;
  color: #1c1c1c;
  display: block;
  text-align: left;
  padding: 5px;
  margin: 0 auto;
  transition: color 0.3s ease;
  font-family: 'Quicksand', 'Poppins', sans-serif;
}

.menu__links__section > a:hover {
  color: #ff4d6d;
}

body.darkmode .menu__links__section > a {
	color: #fff;
}

.close__btn {
  border: none;
  outline: none;
  border-radius: 50%;
  padding: 0.4rem 0.5rem;
  font-size: clamp(1.23rem, calc(1.23rem + 0.22vw), 1.35rem);
  display: grid;
  margin: 0 auto 1rem auto;
  place-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.darkmode .close__btn {
        background-color: rgba(0, 0, 0, 0.5);
}

.nav__container {
  position: sticky;
  top: 0;
  background-color: #fff;
  color: #1c1c1c;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

body.darkmode .nav__container {
        background-color: #2c2c2c;
        box-shadow: 0 1px 3px rgba(230, 210, 210, 0.3);
}

.nav {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto;
  padding: 1.5rem 0.4rem;
  width: 85%;
  position: relative;
}

.nav__div1 > button {
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
}

.nav__div1 > button > img {
  width: clamp(2.05rem, calc(2.05rem + 0.22vw), 2.2rem);
  height: auto;
  transition: filter 0.3s ease;
}

.nav__div2 > a {
  color: #111;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 1.3rem;
  font-weight: 550;
  transition: color 0.3s ease;
}

body.darkmode .nav__div2 > a {
	color: #fff;
}

.nav__div3 > button {
  color: #ff4d6d;
}

.nav__div3 > a > img {
  width: clamp(2.05rem, calc(2.05rem + 0.22vw), 2.2rem);
  height: auto;
  transition: filter 0.3s ease;
}

.footer__div {
  width: 100%;
  /*display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;*/
  display: grid;
  place-content: center;
  flex: 1;
  background-color: #fff;
  padding: 50px 0;
}

.footer__div p {
	text-align: center;
}

body.darkmode .footer__div p {
	color: #fff;
}

body.darkmode .footer__div {
  background-color: #1c1c1c;
}

.tos__privacy {
	color: #ff4d6d;
	margin: 0 3px;
}

/** The New Footer */
.legal-links {
    margin: 10px auto 0 auto;
}

.legal-links a {
    /*color: var(--primary-love);*/
    color: #4356ff;
    text-decoration: 1px underline;
    font-size: 0.9rem;
}

.legal-links a:hover {
	color: midnightblue;
    text-decoration: underline;
}
/*
.hr__footer {
  width: 85%;
  margin: 0 auto;
  border: none;
  height: 1.5px;
  background-color: #fff;
}

body.darkmode .hr__footer {
        background-color: #fff;
}

.footer {
  text-align: center;
  margin: 2rem 0;
  color: #1c1c1c;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}
*/
.footer p {
        font-size: 0.9rem;
}

body.darkmode .footer p {
        color: #eee;
}

/* Floating hearts animation */
.floating-hearts {
    position: fixed;
    top: 150px;
    left: 150px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.heart {
    position: absolute;
    font-size: 20px;
    opacity: 0.3;
    animation: float 8s infinite ease-in-out;
}

.heart:nth-child(1) { left: 10%; animation-delay: 0s; }
.heart:nth-child(2) { left: 20%; animation-delay: 1s; }
.heart:nth-child(3) { left: 50%; animation-delay: 2s; }
.heart:nth-child(4) { left: 70%; animation-delay: 3s; }
.heart:nth-child(5) { left: 90%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-100px) rotate(180deg); opacity: 0.6; }
}

/* Envelope magic */
.confession-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
    justify-content: center;
    padding: 2rem 1rem;
}

.envelope {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    perspective: 1000px;
}

.envelope-body {
    background: linear-gradient(135deg, var(--primary-love), var(--secondary-love));
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 10px 30px rgba(255, 107, 139, 0.3);
    transform-style: preserve-3d;
}

.envelope-flap {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 300px solid transparent;
    border-right: 300px solid transparent;
    border-bottom: 40px solid var(--deep-love);
    z-index: 2;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.envelope.opened .envelope-flap {
    transform: translateX(-50%) rotateX(180deg);
    opacity: 0.7;
}

/* The beautiful confession card */
.confession-card {
    background: var(--paper-cream);
    border-radius: 6px;
    padding: 3rem 2rem;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 0 50px rgba(255, 175, 204, 0.1);
    border: 1px solid rgba(255, 175, 204, 0.3);
    transform: translateY(0);
    transition: all 0.5s ease;
}

.envelope.opened .confession-card {
    transform: translateY(-10px);
}

/* Romantic seal */
.seal {
    position: absolute;
    top: -15px;
    right: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wax {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--deep-love), var(--accent-gold));
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 10px rgba(255, 77, 109, 0.5);
}

.wax::after {
    content: '❤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
}

/* Beautiful typography */
.confession-header {
    text-align: center;
    margin-bottom: 2rem;
}

.confession-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--deep-love);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.title-underline {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin: 0.5rem auto;
    border-radius: 2px;
}

/* Paper texture for the confession text */
.confession-text {
    margin: 2rem 0;
}

.paper-texture {
    background: var(--paper-cream);
    padding: 2rem;
    border-radius: 4px;
    position: relative;
    border-left: 3px solid var(--soft-pink);
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.05),
        0 2px 10px rgba(0, 0, 0, 0.05);
}

.paper-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 98%, rgba(0,0,0,0.03) 99%),
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.3;
}

.result__paragraph {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--ink-love);
    text-align: justify;
    margin: 0;
    position: relative;
    z-index: 1;
    white-space: pre-wrap;
}

/* Beautiful buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-love), var(--deep-love));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 139, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 139, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-love);
    border: 2px solid var(--primary-love);
}

.btn-secondary:hover {
    background: var(--primary-love);
    color: white;
    transform: translateY(-2px);
}

.btn-romantic {
    background: linear-gradient(135deg, var(--accent-gold), #ff9e6d);
    color: var(--ink-love);
    box-shadow: 0 4px 15px rgba(255, 209, 102, 0.4);
}

.btn-romantic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.6);
}

/* Heartbeat animation */
.heartbeat {
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Error and offline messages */
.error__message {
    color: var(--deep-love) !important;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    padding: 1rem;
    background: rgba(255, 107, 139, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--deep-love);
}

.offline__notice {
    color: var(--accent-gold);
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    padding: 0.5rem;
    background: rgba(255, 209, 102, 0.1);
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Navigation enhancements */
.logo {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem !important;
    font-weight: 700;
}

/* Footer romance */
.hr__footer {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-love), transparent);
    margin: 3rem auto 1rem;
    max-width: 400px;
}

.footer {
    text-align: center;
    color: var(--primary-love);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .confession-card {
        padding: 2rem 1rem;
        min-height: 300px;
    }
    
    .confession-title {
        font-size: 2rem;
    }
    
    .result__paragraph {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .envelope-flap {
        border-left: 150px solid transparent;
        border-right: 150px solid transparent;
    }
}

@media (max-width: 480px) {
	.nav__div2 > a {
		font-size: 1.15rem;
	}
}

/* Loading state */
.confession-card.loading {
    position: relative;
    overflow: hidden;
}

.confession-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

        @media print {
            .action-buttons, .offline__msg__manager, .nav, .theme__choice__container,
            .floating-hearts, .envelope-flap, .seal {
                display: none !important;
            }

            .confession-card {
                border: none !important;
                box-shadow: none !important;
                transform: none !important;
                margin: 0 !important;
            }

            .envelope, .envelope-body {
                all: unset !important;
            }

            body {
                background: white !important;
                color: black !important;
                padding: 20px !important;
            }

            .paper-texture {
                background: white !important;
                border: 1px solid #ccc !important;
            }
        }

        #printBtn, #shareBtn {
            cursor: pointer;
            transition: all 0.3s ease;
        }

.confession-card {
	position: relative;
}

.copy__btn {
        outline: none;
        border: none;
        background-color: #ff6d8d;
        color: #fff;
        border-radius: 12px;
        font-size: 1.75rem;
        font-weight: 650;
        padding: 2.5px 25px;
        box-shadow: -2px 4px 10px rgba(255, 209, 102, 0.6);
        font-family: "Poppins", sans-serif;
        position: absolute;
        bottom: 15px;
        right: 10px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
}

.copy__btn:hover {
        box-shadow: 0 6px 15px #FF6F19;
        transform: translateY(-3px);
}
