/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0eaff 0%, #fceabb 50%, #b8ffec 100%);
    color: #232526;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 540px;
    margin: 3rem auto;
    padding: 2.5rem 2rem 2rem 2rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px 0 rgba(180, 200, 255, 0.18);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(200,200,255,0.18);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background: radial-gradient(circle at 30% 30%, #b8ffec 0%, #e0eaff 60%, #fceabb 100%);
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #7f9cf5 0%, #fcb7b7 60%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* text-fill-color: transparent; */
    filter: drop-shadow(0 2px 12px #b8ffec88);
}

header p {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 0.5rem;
}

main {
    position: relative;
    z-index: 1;
}

.input-section {
    margin-bottom: 2.5rem;
    background: rgba(255,255,255,0.75);
    border-radius: 1.2rem;
    box-shadow: 0 2px 16px 0 rgba(180, 200, 255, 0.10);
    padding: 1.5rem 1rem 1.2rem 1rem;
    border: 1.5px solid rgba(180,200,255,0.10);
    transition: box-shadow 0.3s;
}

.input-section:focus-within {
    box-shadow: 0 0 0 3px #b8ffec55;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #7f9cf5;
    font-size: 1.08rem;
}

textarea {
    width: 100%;
    min-height: 110px;
    padding: 1rem;
    border: none;
    border-radius: 0.8rem;
    font-family: inherit;
    font-size: 1.08rem;
    background: rgba(240,245,255,0.95);
    color: #232526;
    box-shadow: 0 1px 8px 0 rgba(127, 90, 240, 0.04);
    resize: vertical;
    transition: background 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    background: rgba(36, 39, 56, 1);
    box-shadow: 0 0 0 2px #7f5af0cc;
}

.char-counter {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.92rem;
    color: #6ee7b7;
    font-weight: 500;
}

.generate-btn {
    width: 100%;
    padding: 1.1rem 2rem;
    background: linear-gradient(90deg, #7f9cf5 0%, #fcb7b7 60%, #6ee7b7 100%);
    color: #232526;
    border: none;
    border-radius: 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1.2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px 0 rgba(180, 200, 255, 0.18);
    transition: transform 0.18s, box-shadow 0.18s, background 0.3s;
    z-index: 1;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 32px 0 rgba(180, 200, 255, 0.18), 0 2px 16px 0 rgba(180, 200, 255, 0.18);
    background: linear-gradient(90deg, #6ee7b7 0%, #7f9cf5 60%, #fcb7b7 100%);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(127,90,240,0.18);
    border-top: 3px solid #7f5af0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-section {
    margin-top: 2.2rem;
    background: rgba(255,255,255,0.75);
    border-radius: 1.2rem;
    box-shadow: 0 2px 16px 0 rgba(180, 200, 255, 0.10);
    padding: 1.5rem 1rem 1.2rem 1rem;
    border: 1.5px solid rgba(180,200,255,0.10);
    transition: box-shadow 0.3s;
    min-height: 120px;
}

.output-section h3 {
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #6ee7b7;
    letter-spacing: 0.5px;
}

.output-area {
    background: rgba(240,245,255,0.7);
    border: 1.5px solid rgba(180,200,255,0.10);
    border-radius: 0.8rem;
    padding: 1.2rem;
    min-height: 80px;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 1.08rem;
    color: #232526;
    box-shadow: 0 1px 8px 0 rgba(44, 182, 125, 0.04);
    transition: background 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.7s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.placeholder-text {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.error-message {
    background: rgba(255, 71, 87, 0.10);
    border: 1.5px solid #ffbaba;
    border-radius: 0.8rem;
    padding: 1rem;
    margin-top: 1.2rem;
    color: #ff4757;
    font-weight: 600;
    box-shadow: 0 2px 8px 0 rgba(255, 71, 87, 0.08);
    animation: shake 0.4s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

footer {
    text-align: center;
    margin-top: 2.5rem;
    color: #6b7280;
    opacity: 0.8;
    font-size: 0.98rem;
    letter-spacing: 0.2px;
}

/********* Chat Layout & Bubbles *********/
.chat-container {
    display: flex;
    flex-direction: column;
    min-height: 90vh;
    justify-content: flex-start;
}

.chat-area {
    flex: 1;
    min-height: 320px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 1.2rem;
    background: none;
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
}

.ai-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 0.85rem 1.2rem;
    border-radius: 1.2rem 1.2rem 1.2rem 0.4rem;
    font-size: 1.08rem;
    line-height: 1.6;
    box-shadow: 0 2px 8px 0 rgba(180, 200, 255, 0.10);
    background: linear-gradient(120deg, #e0eaff 60%, #fceabb 100%);
    color: #232526;
    position: relative;
    animation: fadeIn 0.5s;
    word-break: break-word;
}

.user-message .bubble {
    background: linear-gradient(120deg, #b8ffec 60%, #e0eaff 100%);
    color: #232526;
    border-radius: 1.2rem 1.2rem 0.4rem 1.2rem;
    align-self: flex-end;
    box-shadow: 0 2px 8px 0 rgba(110, 231, 183, 0.10);
}

.ai-message .bubble {
    background: linear-gradient(120deg, #fff 60%, #e0eaff 100%);
    color: #232526;
    border-radius: 1.2rem 1.2rem 1.2rem 0.4rem;
    align-self: flex-start;
    box-shadow: 0 2px 8px 0 rgba(127, 156, 245, 0.10);
}

.initial .bubble {
    background: linear-gradient(120deg, #fceabb 60%, #e0eaff 100%);
    color: #6b7280;
    font-style: italic;
}

/********* Chat Input Bar *********/
.chat-input-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 2px 8px 0 rgba(180, 200, 255, 0.10);
    border: 1.5px solid rgba(180,200,255,0.10);
    padding: 0.7rem 0.7rem 0.7rem 0.7rem;
    margin-bottom: 0.2rem;
    gap: 0.5rem;
}

.chat-input-section textarea {
    min-height: 44px;
    max-height: 160px;
    border: none;
    background: transparent;
    color: #232526;
    font-size: 1.08rem;
    padding: 0.7rem 0.8rem;
    border-radius: 1.2rem;
    resize: none;
    outline: none;
    box-shadow: none;
    transition: background 0.2s;
    overflow-y: auto;
    line-height: 1.5;
    margin: 0;
    width: 100%;
}

.chat-input-section textarea:focus {
    background: #f8fafc;
}

.generate-btn {
    background: linear-gradient(120deg, #a1c4fd 0%, #fbc2eb 100%);
    color: #232526;
    border: none;
    border-radius: 1.2rem;
    padding: 0.7rem 1.5rem;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px 0 rgba(180, 200, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-left: 0;
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/********* Responsive Tweaks *********/
@media (max-width: 768px) {
    .container {
        max-width: 100vw;
        padding: 0.5rem;
    }
    .chat-area {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.2rem;
        margin: 0.2rem auto;
    }
    .chat-area {
        padding: 0.2rem 0.2rem 1rem 0.2rem;
        max-height: 32vh;
    }
    .bubble {
        font-size: 0.98rem;
        padding: 0.7rem 0.8rem;
    }
} 
