/**
 * Birthday Freestyle Submissions - JoeDreamz Theme
 * Version: 2.0.0
 * Matches JoeDreamz.com design aesthetics
 */

/* Import Poppins Font (JoeDreamz brand font) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* Body & Background */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-image: url('images/spacescape.jpg');
    background-size: cover;
    background-repeat: repeat;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem 1rem;
    margin: 0;
    position: relative;
}

/* Animated background overlay for depth */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 0, 20, 0.4) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Form Wrapper - Speech Bubble Style */
.birthday-freestyle-form-wrapper {
    max-width: 650px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 35px;
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 204, 0, 0.3);
    border: 3px solid #fff;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

/* Speech bubble arrow pointing up */
.birthday-freestyle-form-wrapper::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 25px solid #fff;
    filter: drop-shadow(3px -3px 6px rgba(0, 0, 0, 0.3));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header with JoeDreamz branding */
.bfs-form-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.bfs-form-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffcc00, #ff6699);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% {
        background: linear-gradient(135deg, #ffcc00, #ff6699);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        background: linear-gradient(135deg, #ff6699, #ffcc00);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.bfs-form-header p {
    color: #444;
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 400;
}

/* JoeDreamz Logo/Image */
.bfs-joedreamz-image {
    width: 120px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Form Groups */
.bfs-form-group {
    margin-bottom: 1.8rem;
}

.bfs-form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: #222;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.bfs-form-group .required {
    color: #ff6699;
    font-weight: 700;
}

/* Input Fields - JoeDreamz style */
.bfs-form-group input[type="text"],
.bfs-form-group input[type="email"],
.bfs-form-group input[type="date"],
.bfs-form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
}

.bfs-form-group input:focus,
.bfs-form-group textarea:focus {
    outline: none;
    border-color: #ffcc00;
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.2);
    background: #fffef8;
}

.bfs-form-group textarea {
    resize: vertical;
    min-height: 140px;
}

/* Character Counter */
.bfs-char-count {
    text-align: right;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.35rem;
    font-weight: 500;
}

/* Error Messages */
.bfs-error {
    display: block;
    color: #ff6699;
    font-size: 0.88rem;
    margin-top: 0.4rem;
    min-height: 1.2em;
    font-weight: 500;
}

.bfs-form-group.has-error input,
.bfs-form-group.has-error textarea {
    border-color: #ff6699;
    background: #fff5f8;
}

/* Submit Button - JoeDreamz gradient */
.bfs-submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, #ffcc00 0%, #ff6699 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.03em;
    box-shadow: 0 4px 10px rgba(255, 102, 153, 0.3);
}

.bfs-submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 102, 153, 0.5);
    background: linear-gradient(135deg, #ffd633 0%, #ff7aa8 100%);
}

.bfs-submit-btn:active {
    transform: translateY(-1px);
}

.bfs-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Button Loading State */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.6rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.bfs-message {
    padding: 1.2rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    font-size: 1rem;
    animation: slideIn 0.4s ease;
    font-weight: 500;
    text-align: center;
}

.bfs-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

.bfs-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .birthday-freestyle-form-wrapper {
        margin: 1rem;
        padding: 2rem 1.5rem;
        border-radius: 25px;
    }

    .birthday-freestyle-form-wrapper::before {
        top: -30px;
        border-left: 20px solid transparent;
        border-right: 20px solid transparent;
        border-bottom: 20px solid #fff;
    }

    .bfs-form-header h2 {
        font-size: 1.8rem;
    }

    .bfs-form-header p {
        font-size: 0.95rem;
    }

    .bfs-form-group input,
    .bfs-form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .bfs-joedreamz-image {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .birthday-freestyle-form-wrapper {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }

    .bfs-form-header h2 {
        font-size: 1.5rem;
    }

    .bfs-submit-btn {
        padding: 1rem;
        font-size: 1.05rem;
    }

    .bfs-joedreamz-image {
        width: 80px;
    }
}

/* Landscape Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .birthday-freestyle-form-wrapper {
        max-width: 700px;
    }
}

/* Dark Mode Support (maintain JoeDreamz vibrancy) */
@media (prefers-color-scheme: dark) {
    .birthday-freestyle-form-wrapper {
        background: rgba(40, 40, 50, 0.95);
        border-color: #ffcc00;
    }

    .birthday-freestyle-form-wrapper::before {
        border-bottom-color: rgba(40, 40, 50, 0.95);
    }

    .bfs-form-header p {
        color: #ddd;
    }

    .bfs-form-group label {
        color: #f0f0f0;
    }

    .bfs-form-group input,
    .bfs-form-group textarea {
        background: #2a2a35;
        border-color: #555;
        color: #f0f0f0;
    }

    .bfs-form-group input:focus,
    .bfs-form-group textarea:focus {
        background: #32323f;
        border-color: #ffcc00;
    }

    .bfs-char-count {
        color: #aaa;
    }
}

/* Accessibility */
.bfs-form-group input:focus-visible,
.bfs-form-group textarea:focus-visible,
.bfs-submit-btn:focus-visible {
    outline: 3px solid #ffcc00;
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .birthday-freestyle-form-wrapper {
        box-shadow: none;
        border: 2px solid #ddd;
    }

    .birthday-freestyle-form-wrapper::before {
        display: none;
    }

    .bfs-submit-btn {
        display: none;
    }
}

/* Floating Animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.bfs-floating {
    animation: float 3s ease-in-out infinite;
}
