/* ═══════════════════════════════════════════════════════════════════
   caglaax3 Freundebuch – Süß, pink, girly Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --pink-50:  #fdf2f8;
    --pink-100: #fce7f3;
    --pink-200: #fbcfe8;
    --pink-300: #f9a8d4;
    --pink-400: #f472b6;
    --pink-500: #ec4899;
    --pink-600: #db2777;
    --pink-700: #be185d;

    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-400: #c084fc;
    --purple-500: #a855f7;

    --cream:    #fff9f0;
    --text:     #4a1942;
    --text-light: #7c3a6b;
    --white:    #ffffff;
    --shadow:   rgba(236, 72, 153, 0.15);
    --shadow-lg: rgba(236, 72, 153, 0.25);

    --radius:   16px;
    --radius-sm: 10px;
    --radius-full: 9999px;

    --font-body:    'Quicksand', 'Segoe UI', sans-serif;
    --font-display: 'Pacifico', cursive;
}

/* ── Reset & Basis ───────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--pink-50) 0%, var(--cream) 50%, var(--purple-100) 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* ── Navbar ──────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--pink-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--pink-600);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--pink-100);
    color: var(--pink-600);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.8rem;
    background: var(--pink-50);
    border-radius: var(--radius-full);
    border: 2px solid var(--pink-200);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--pink-300);
}

.nav-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.nav-logout {
    font-size: 0.85rem;
    color: var(--pink-400);
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-lg {
    padding: 1rem 2.2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
    color: var(--white);
    box-shadow: 0 4px 20px var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-discord {
    background: #5865F2;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.4);
}

.discord-icon {
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Main ────────────────────────────────────────────────────────── */

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 4rem 1rem;
    position: relative;
}

.hero-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
    opacity: 0.6;
}
.sparkle:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 20%; right: 15%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 1s; }
.sparkle:nth-child(4) { top: 30%; right: 25%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { bottom: 10%; right: 10%; animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-15px) rotate(10deg); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.title-accent {
    background: linear-gradient(135deg, var(--pink-500), var(--purple-500));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 4rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Features ────────────────────────────────────────────────────── */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 0 1rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    border: 2px solid var(--pink-100);
    transition: transform 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.8rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--pink-600);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ── Freundebuch-Seite ───────────────────────────────────────────── */

.freundebuch-page {
    padding: 1rem 0;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    color: var(--pink-600);
    margin-bottom: 0.3rem;
}

.page-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.freundebuch-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* ── Formular ────────────────────────────────────────────────────── */

.form-panel {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 25px var(--shadow);
    border: 2px solid var(--pink-100);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--pink-600);
    margin-bottom: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--pink-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--pink-50);
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.form-input:focus {
    outline: none;
    border-color: var(--pink-400);
    box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.15);
    background: var(--white);
}

.form-input::placeholder {
    color: var(--pink-300);
}

.btn-submit {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: center;
}

/* ── Formular-Nachricht ──────────────────────────────────────────── */

.form-message {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
}

.form-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 2px solid #bbf7d0;
}

.form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 2px solid #fecaca;
}

/* ── Vorschau ────────────────────────────────────────────────────── */

.preview-panel {
    position: sticky;
    top: 80px;
}

.preview-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--pink-600);
    text-align: center;
    margin-bottom: 1rem;
}

.preview-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 25px var(--shadow);
    border: 2px solid var(--pink-100);
    overflow: hidden;
    padding: 0.5rem;
}

#preview-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

/* ── Erfolgsanzeige ──────────────────────────────────────────────── */

.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(253, 242, 248, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.success-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px var(--shadow-lg);
    text-align: center;
    max-width: 500px;
    border: 3px solid var(--pink-300);
}

.success-card h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--pink-600);
    margin-bottom: 0.5rem;
}

.success-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.success-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border: 2px solid var(--pink-200);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Alert ───────────────────────────────────────────────────────── */

.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 2px solid #fecaca;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 2px solid var(--pink-100);
    background: rgba(255, 255, 255, 0.5);
}

/* ── Loading Spinner ─────────────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.7s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .freundebuch-container {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
        order: -1;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .title-accent {
        font-size: 3rem;
    }
}

/* ── Zeichenfeld ─────────────────────────────────────────────────── */

#drawing-canvas {
    width: 100%;
    height: 240px;
    border: 2px solid var(--pink-200);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.drawing-toolbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.drawing-colors {
    display: flex;
    gap: 0.3rem;
}

.color-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.color-btn.active,
.color-btn:hover {
    border-color: var(--pink-400);
    transform: scale(1.15);
}

.drawing-sizes {
    display: flex;
    gap: 0.3rem;
}

.size-btn {
    padding: 0.2rem 0.6rem;
    border: 2px solid var(--pink-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn.active,
.size-btn:hover {
    background: var(--pink-100);
    border-color: var(--pink-400);
    color: var(--pink-600);
}

.btn-clear-drawing {
    padding: 0.2rem 0.5rem;
    border: 2px solid var(--pink-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-clear-drawing:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .title-accent {
        font-size: 2.5rem;
    }

    .form-panel {
        padding: 1.2rem;
    }
}
