*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Stack Sans Notch';
    text-decoration: none;
    scroll-behavior: smooth;
    list-style: none;
}

body {
    background: linear-gradient(135deg, 
        #e0c3fc 0%, 
        #8ec5fc 50%, 
        #fbc2eb 100%
    );
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling */
    padding-bottom: 80px;
}

body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(0, 157, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

header{
    position: fixed;
    top: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    margin-bottom: 10rem;
    background-color: black;
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

header.hidden {
    transform: translate(-50%, -100px);
    opacity: 0;
    pointer-events: none;
}

.logo{
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-wrap: nowrap;
    transition: .3s ease-in-out;
}

.logo:hover{
    transform: scale(1.1);
    background: linear-gradient(to right, rgb(0, 157, 255), rgb(255, 0, 255));
    background-clip: text;
    color: transparent;
}

.tagline {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.7);
    gap: 1rem;
    margin-top: 4rem;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.input-box{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.input-box .userIn{
    position: relative;
    border-radius: 1.5rem;
    border: 2px solid black;
    width: 60%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    resize: none;
    min-height: 50px;
    max-height: 300px;
    font-family: 'Stack Sans Notch';
    line-height: 1.5;
    overflow-y: auto;
    field-sizing: content;
    transition: border 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.input-box .userIn:focus {
    border: 2px solid rgb(0, 157, 255);
    box-shadow: 0 0 20px rgba(0, 157, 255, 0.3);
    outline: none;
}

.input-box .userIn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/*error placeholder styling*/
.input-box .userIn.error-placeholder::placeholder {
    color: red;
    opacity: 1;
}

.input-box .btn{
    border-radius: 3rem;
    border: 2px solid black;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    text-wrap: nowrap;
    transition: 0.2s ease-in-out;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.input-box .btn:hover{
    transform: scale(1.1);
    background-color: grey;
}

.input-box .btn:hover:not(:disabled) {
    transform: scale(1.1);
    background-color: grey;
}

.input-box .btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.input-box .btn.loading {
    display: none;
}

.input-box .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.input-box .btn:active::after {
    width: 300px;
    height: 300px;
}

.spinner {
    display: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgb(0, 157, 255), rgb(255, 0, 255), rgb(0, 157, 255));
    animation: spin 0.8s linear infinite;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
}

.spinner.visible {
    display: block;
}

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

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    z-index: 999;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.footer-links {
    margin: 0.5rem 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: rgb(0, 157, 255);
}

.separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.disclaimer {
    margin: 0.5rem 0 0 0;
    font-size: 0.75rem;
    opacity: 0.7;
}

/*Adjust main content to account for footer*/
body {
    padding-bottom: 80px;
}

.button-row {
    display: none;
    width: 60%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.button-row.visible {
    display: flex !important;
}

/*Position enhance new prompt button to the right*/
.button-row .new-prompt-btn {
    position: absolute;
    right: 0;
}


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

/*Enhanced Prompt Badge*/
.enhanced-badge {
    display: none;
    background: linear-gradient(135deg, rgb(0, 157, 255), rgb(255, 0, 255));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 157, 255, 0.4);
    animation: fadeInBounce 0.5s ease-out;
}

.enhanced-badge.visible {
    display: inline-block !important;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    60% {
        transform: translateY(5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Error Message */
.error-message {
    display: none;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: shake 0.5s ease-out;
    text-align: center;
}

.error-message.visible {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.error-icon {
    font-size: 1.2rem;
}

.error-text {
    font-weight: 600;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/*Error Button Row*/
.error-button-row {
    display: none;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: -1rem; /* Adjust to match normal button spacing */
}

.error-button-row.visible {
    display: flex !important;
}

.try-again-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
}

.try-again-btn:hover {
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
    transform: scale(1.05);
}

#serverResponse{
    display: none;
    position: relative;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 20px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    font-size: 16px;
    field-sizing: content;
    max-height: 50vh;
    overflow-y: auto;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Tablets and smaller laptops (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .input-box .userIn,
    #serverResponse,
    .button-row,
    .error-button-row {
        width: 75%;
    }
    
    header {
        padding: 0.4rem 1.2rem;
        font-size: 1.1rem;
    }
    
    .input-box {
        margin-top: 6rem;
    }
}

/* Mobile devices (up to 768px) */
@media screen and (max-width: 768px) {
    body {
        padding-bottom: 150px; /* More space for larger footer on mobile */
    }
    
    .tagline {
        font-size: 0.9rem;
        margin-top: 4rem;
        margin-bottom: 0;
        padding: 0 1.5rem;
    }
    
    .input-box {
        margin-top: 1.5rem;
    }
    
    header {
        top: 0.5rem;
        padding: 0.4rem 1rem;
        border-radius: 8px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .input-box {
        margin-top: 5rem;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .input-box .userIn,
    #serverResponse {
        width: 90%;
        font-size: 0.95rem;
        padding: 0.65rem 0.9rem;
    }
    
    .input-box .btn {
        padding: 0.6rem 1.8rem;
        font-size: 0.95rem;
    }
    
    /* Button row adjustments for mobile */
    .button-row {
        width: 90%;
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .button-row .new-prompt-btn {
        position: static; /* Remove absolute positioning on mobile */
    }
    
    .error-button-row {
        width: 90%;
    }
    
    /* Badges and messages */
    .enhanced-badge,
    .error-message {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
    }
    
    /* Footer adjustments */
    .footer {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
    
    .disclaimer {
        font-size: 0.7rem;
    }
}

/* Small mobile devices (up to 480px) */
@media screen and (max-width: 480px) {
    .tagline {
        font-size: 0.85rem;
        margin-top: 3.5rem;
        margin-bottom: 0;
        padding: 0 1rem;
    }
    
    .input-box {
        margin-top: 1.2rem;
    }
    
    header {
        top: 0.3rem;
        padding: 0.3rem 0.8rem;
        border-radius: 6px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .input-box {
        margin-top: 4rem;
        gap: 1.2rem;
        padding: 0 0.5rem;
    }
    
    .input-box .userIn,
    #serverResponse {
        width: 95%;
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
        min-height: 45px;
    }
    
    .input-box .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .button-row,
    .error-button-row {
        width: 95%;
    }
    
    .enhanced-badge,
    .error-message {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }
    
    .error-icon {
        font-size: 1rem;
    }
    
    .spinner {
        width: 25px;
        height: 25px;
    }
    
    .footer {
        padding: 0.6rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .copyright {
        font-size: 0.75rem;
    }
    
    .footer-links a {
        font-size: 0.7rem;
    }
    
    .disclaimer {
        font-size: 0.65rem;
    }
    
    .separator {
        margin: 0 0.3rem;
    }
}

/* Very small devices (up to 360px) */
@media screen and (max-width: 360px) {
    .logo {
        font-size: 0.9rem;
    }
    
    .input-box .userIn,
    #serverResponse {
        width: 98%;
        font-size: 0.85rem;
    }
    
    .input-box .btn {
        padding: 0.45rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .enhanced-badge,
    .error-message {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .input-box {
        margin-top: 3rem;
    }
    
    header {
        padding: 0.3rem 1rem;
    }
    
    body {
        padding-bottom: 80px;
    }
    
    .footer {
        padding: 0.5rem;
    }
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    color: #333;
    padding-right: 2rem;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(80vh - 120px);
    padding-right: 1rem;
    color: #444;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modal responsive adjustments */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .modal-close {
        top: 0.75rem;
        right: 1rem;
        font-size: 1.8rem;
    }
    
    .modal-body {
        font-size: 0.9rem;
        max-height: calc(85vh - 100px);
    }
}

@media screen and (max-width: 480px) {
    .modal-content {
        padding: 1.2rem;
        border-radius: 0.75rem;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        font-size: 0.85rem;
    }
}