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

body {
    background-color: #CBF3BB;
    font-family: "Poppins", sans-serif;
    color: #4E61D3;
    padding: 20px;
    min-height: 100vh;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
}

h3 {
    color: #fa5914;
    font-size: 1.8rem;
    margin-bottom: 15px;
    margin-top: 30px;
}

/* Main container */
.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Input section */
#inputText {
    width: 100%;
    height: 120px;
    padding: 12px;
    color: black;
    background-color: white;
    border: 2px solid #4E61D3;
    border-radius: 8px;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#inputText:focus {
    outline: none;
    border-color: #FF8F8F;
    box-shadow: 0 0 8px rgba(255, 143, 143, 0.3);
}

/* Control row */
.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

label {
    font-size: 1.2rem;
    font-weight: 500;
}

#lengthSelect {
    padding: 8px 12px;
    color: #103570;
    background-color: #BADFDB;
    font-size: 1rem;
    border: 2px solid #4E61D3;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#lengthSelect:hover {
    background-color: #a3ccd1;
    transform: translateY(-2px);
}

#lengthSelect:focus {
    outline: none;
    border-color: #FF8F8F;
    box-shadow: 0 0 8px rgba(255, 143, 143, 0.3);
}

/* Buttons */
button {
    padding: 12px 24px;
    font-size: 1rem;
    font-family: "Poppins", sans-serif;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: aliceblue;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#summarizeBtn {
    background-color: #FF8F8F;
}

#summarizeBtn:hover:not(:disabled) {
    background-color: #ff7070;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 143, 143, 0.3);
}

#summarizeBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 143, 143, 0.5);
}

#summarizeBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#showFullBtn {
    background-color: #6DB3F2;
}

#showFullBtn:hover:not(:disabled) {
    background-color: #5a9fd9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(109, 179, 242, 0.3);
}

#showFullBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(109, 179, 242, 0.5);
}

#showFullBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading animation */
#loading {
    font-size: 1rem;
    color: black;
    min-height: 20px;
    transition: opacity 0.3s ease;
    opacity: 0;
    font-weight: 600;
}

#loading:not(:empty) {
    opacity: 1;
}

/* Output section */
#output {
    color: black;
    font-size: 1.05rem;
    line-height: 1.6;
    padding: 20px;
    background-color: white;
    border: 2px solid #4E61D3;
    border-radius: 8px;
    min-height: 100px;
    opacity: 0;
    transition: opacity 0.6s ease;
    margin-top: 20px;
}

#output::after {
    content: '|';
    opacity: 1;
    animation: blink 0.8s infinite;
    margin-left: 4px;
}

#output.done::after {
    content: '';
    animation: none;
}

#output.show {
    opacity: 1;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    label {
        margin-bottom: 5px;
    }

    #lengthSelect {
        width: 100%;
    }

    button {
        width: 100%;
    }

    .button-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #output {
        font-size: 1rem;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    h3 {
        font-size: 1.2rem;
        margin-top: 20px;
    }

    button {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    #inputText {
        height: 100px;
        font-size: 0.95rem;
    }
}