@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --body-bg: #072D44;
    --card-bg: #D0D7E1;

    --primary-accent: #5790AB;
    --secondary-accent: #9CCDDB;
    --tertiary-dark-blue: #064469;

    --text-on-card: var(--body-bg);
    --text-subtle-on-card: var(--tertiary-dark-blue);
    --text-on-dark-bg: var(--card-bg);

    --border-dark: var(--tertiary-dark-blue);
    --border-light: var(--primary-accent);

    --shadow-dark: rgba(0, 0, 0, 0.5);
    --shadow-light-inset: rgba(0, 0, 0, 0.1);
    --error-color: #EF4444;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--body-bg);
    color: var(--text-on-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--shadow-dark);
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-top: 50px;
    border: 1px solid var(--border-light);
    position: relative;
}

.logo-container {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 120px;
    height: auto;
    z-index: 10;

    transform-origin: 100% 0%;
    transform: rotate(15deg) translate(20px, -20px);
    opacity: 1;
}

.logo-container img {
    width: 100%;
    height: auto;
    display: block;
}

h1 {
    color: var(--text-on-card);
    margin-bottom: 10px;
    font-size: 2.8em;
    font-weight: 700;
}

.container .gradient-text {
    background: linear-gradient(to right, var(--primary-accent), var(--secondary-accent), var(--tertiary-dark-blue));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container .underline {
    text-decoration: underline;
    text-decoration-color: var(--primary-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    font-weight: 600;
    display: inline-block;
}

p {
    color: var(--text-subtle-on-card);
    line-height: 1.7;
    margin-bottom: 25px;
}

/* Upload Area Styling */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 25px;
    border: 2px dashed var(--border-dark);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 2px 5px var(--shadow-light-inset);
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-file-upload {
    border: 1px solid var(--tertiary-dark-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    cursor: pointer;
    background-color: var(--body-bg);
    color: white;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: 600;
    font-size: 1.05em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.custom-file-upload:hover {
    background-color: var(--tertiary-dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.custom-file-upload input[type="file"] {
    display: none;
}

#file-name {
    font-size: 1em;
    color: var(--text-on-card);
    font-weight: 500;
    flex-grow: 1;
    text-align: left;
    padding-left: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Remove File Button Styling */
.remove-file-btn {
    background: none;
    border: none;
    color: var(--text-subtle-on-card);
    font-size: 1.6em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 5px;
}

.remove-file-btn:hover {
    transform: scale(1.1);
    color: var(--error-color);
}

/* Summarize Button Styling */
button#summarize-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: var(--primary-accent);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 195px;
    margin: 20px auto 30px auto;
    display: block;
}

button#summarize-btn:hover:not(:disabled) {
    background-color: var(--primary-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background-color: var(--border-dark);
    color: var(--text-subtle-on-card);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button#summarize-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 238, 255, 0.705), transparent);
    transition: none;
    z-index: -1;
}

button#summarize-btn.highlight-animation::before {
    animation: slideHighlight 1s linear infinite ;
}

@keyframes slideHighlight {
    from {
        left: -100%;
    }
    to {
        left: 100%;
    }
}

/* Summary Area Styling */
.summary-area {
    text-align: left;
    margin-top: 10px;
    position: relative;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-dark);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.summary-area h2 {
    color: var(--text-on-card);
    font-size: 2em;
    margin: 0;
    padding-bottom: 10px;
}

#summary-output {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 25px;
    padding-top: 5px;
    min-height: 180px;
    text-align: justify;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: inset 0 2px 5px var(--shadow-light-inset);
    color: var(--text-on-card);
    line-height: 1.8;
    position: relative;
}

#summary-output p {
    margin: 0;
    padding-top: 0;
    color: var(--text-on-card);
    text-align: center;
    line-height: 1.8;
}

/* Copy Button Styling */
.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-subtle-on-card);
    font-size: 1em;
    border-radius: 5px;
}

#copy-text-span {
    font-size: 1.0em;
    margin-top: 7px;
    white-space: nowrap;
}

.copy-btn i {
    color: var(--text-subtle-on-card);
    font-size: 1.8em;
    transition: color 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover i {
    color: var(--primary-accent);
    transform: translateY(-2px);
}

.copy-btn:hover i {
    color: var(--primary-accent);
}

.copy-btn.copied i {
    color: var(--primary-accent);
}

.copy-btn {
    display: none;
}



/* Loading Spinner */
.spinner-hidden {
    display: none;
}

#loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-accent);
    border-right: 4px solid var(--primary-accent);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    animation: combinedSpinner 1.5s linear infinite; 
    margin: 25px auto 15px auto;
    box-shadow: 0 0 15px rgba(87, 144, 171, 0.7);
}

/* spinning and pulsing */
@keyframes combinedSpinner {
    0% {
        transform: rotate(0deg) scale(0.9);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) scale(0.9);
        opacity: 0.8;
    }
}

/* Styles for animating dots */
.animating-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
    width: 1em;
    font-size: 1em;
    line-height: 1;
    white-space: pre;
}

@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.loading-message-hidden {
    display: none;
}

#ppt-loading-message {
    color: var(--text-subtle-on-card);
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.error-hidden {
    display: none;
}

#error-message {
    color: white;
    background-color: var(--error-color);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 18px;
    margin-top: 25px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.footer {
    color: var(--text-on-dark-bg);
    text-align: center;
    margin-top: 30px;
    font-size: 0.9em;
    opacity: 0.8;
}

.footer p {
    margin: 0;
    color: #FFFFFF;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 25px;
        margin-top: 20px;
    }

    .logo-container {
        width: 80px;
        transform: rotate(15deg) translate(15px, -15px);
    }

    h1 {
        font-size: 2.2em;
    }

    .custom-file-upload {
        text-align: center;
        box-sizing: border-box;
        width: 100%;
    }

    button#summarize-btn {
        max-width: 195px;
    }

    .file-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #file-name {
        width: 100%;
        text-align: center;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left: 0;
    }

    .copy-btn {
        padding: 3px 8px;
        top: 8px;
        right: 8px;
        gap: 15px;
    }

    #copy-text-span {
        margin-top: 7px;
        white-space: nowrap;
    }

    .copy-btn i {
        color: var(--text-subtle-on-card);
        font-size: 1.8em;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .copy-btn:hover i {
        color: var(--primary-accent);
        transform: translateY(-2px);
    }

    .copy-btn:hover i {
        color: var(--primary-accent);
    }

    .copy-btn.copied i {
        color: var(--primary-accent);
    }

    .copy-btn {
        display: none;
    }

    #summary-output {
        padding: 25px;
        padding-top: 10px;
    }
}