/* --- 1. Variables and Global Styles --- */

:root {
    --primary-blue: #3498db; /* Main Button Color */
    --primary-dark: #1a253c; /* Heading Text Color */
    --secondary-accent: #2ecc71; /* Green for Excellent Scores */
    --warning-orange: #f39c12; /* Orange for Good Scores */
    --error-red: #e74c3c; /* Red for Poor Scores and Errors */
    --text-color: #444; /* Body Text Color */
    --bg-light: #ecf0f1; /* Light Gray for Borders/Backgrounds */
    --container-padding-v: 35px; /* Adjusted vertical padding for height reduction */
    --logo-size: 90px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e0f2f1, #d1f4f8);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    position: relative; /* Anchor for logo positioning */
    overflow-x: hidden;
}

/* --- 2. Logo Styling (Top Left) --- */

.logo-top-left {
    position: absolute;
    top: 25px;
    left: 25px;
    width: var(--logo-size);
    height: auto;
    z-index: 1000;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.logo-top-left:hover {
    transform: scale(1.05);
}

/* --- 3. Main Container and Typography (Height Reduction Applied) --- */

.container {
    background: white;
    /* Height Reduction: Reduced vertical padding */
    padding: var(--container-padding-v) 40px;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 0 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 550px;
    width: 100%;
    transition: transform 0.3s ease-out;
}

.container:hover {
    transform: translateY(-5px);
}

h1 {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 2.2em;
    margin-bottom: 5px;
}

.rocket-icon {
    display: inline-block;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

p {
    color: var(--text-color);
    /* Height Reduction: Reduced bottom margin */
    margin-bottom: 25px;
    font-size: 1.1em;
}

/* --- 4. Input Group and Button Styles --- */

.input-group {
    display: flex;
    gap: 15px;
}

#urlInput {
    flex-grow: 1;
    padding: 14px 18px;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

#rateBtn {
    padding: 14px 25px;
    border: none;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    min-width: 150px;
}

#rateBtn:hover {
    background-color: #2980b9;
}

#rateBtn:active {
    transform: scale(0.98);
}

#rateBtn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* --- 5. Results and Feedback Styles --- */

.validation-message {
    height: 1.5em;
    font-size: 0.9em;
    color: var(--error-red);
    text-align: left;
    margin-top: 10px;
}

.results-container {
    /* Height Reduction: Reduced top margin */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--bg-light);
    text-align: left;
}

.results-container h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.5em;
    border-left: 4px solid var(--secondary-accent);
    padding-left: 10px;
}

.results-container ul {
    list-style: none;
    padding: 0;
}

.results-container li {
    /* Height Reduction: Reduced vertical padding for list items */
    padding: 8px 0;
    border-bottom: 1px dashed var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-container li:last-child {
    border-bottom: none;
}

.results-container li strong {
    font-weight: 600;
}

/* --- 6. Loading and Score Styles --- */

.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-left: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.score-excellent {
    color: var(--secondary-accent);
    font-weight: 700;
}
.score-good {
    color: var(--warning-orange);
    font-weight: 700;
}
.score-poor {
    color: var(--error-red);
    font-weight: 700;
}