/* --- General Styles & Variables --- */
:root {
    /* Light Blue Theme Palette */
    --primary-color: #007bff;        /* Standard Bootstrap Blue */
    --primary-hover-color: #0056b3; /* Darker Blue */
    --secondary-color: #6c757d;     /* Medium Gray */
    --background-color: #eef5ff;    /* Very light blue tint */
    --card-background: #ffffff;     /* White */
    --text-color: #495057;          /* Dark Gray for body text */
    --heading-color: #212529;       /* Darker Gray for headings */
    --border-color: #dee2e6;        /* Light Gray for borders */
    --input-background: #ffffff;    /* White */
    --input-focus-glow: rgba(0, 123, 255, 0.25); /* Blue glow */

    --success-color: #28a745;       /* Green */
    --warning-color: #ffc107;       /* Yellow */
    --danger-color: #dc3545;        /* Red */
    --info-color: #17a2b8;          /* Teal/Info Blue */

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --border-radius: 6px;
    /* Softer shadow for light background */
    --box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --mindmap-bg-color: #f8f9fa;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 25px;
    min-height: 100vh;
}

.container {
    max-width: 850px;
    margin: 40px auto;
    background-color: var(--card-background);
    padding: 40px 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

/* --- Header --- */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

/* --- Placeholder Visual Element in Header --- */
.header-visual-placeholder {
    width: 170px;
    height: 70px;
    /* Gradient using the light theme's blue */
    background: linear-gradient(45deg, var(--primary-color), #4dabf7); /* Lighter shade in gradient */
    border-radius: 50%;
    margin: 0 auto 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff; /* White text on blue */
    font-size: 1.8em;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2); /* Softer blue shadow */
}
.header-visual-placeholder::before {
    content: 'Contizer';
    font-weight: 600;
}

.logo-img {
    margin: 0 auto 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img img {
      width: 300px;
      object-fit: cover;
}


header h1 {
    color: var(--heading-color);
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 2.2em;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.15em;
    font-weight: 400;
}

/* --- Input Section --- */
.input-section {
    margin-bottom: 35px;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--heading-color);
    font-size: 1.05em;
}

#text-input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 20px;
    resize: vertical;
    min-height: 180px;
    background-color: var(--input-background); /* White input */
    color: var(--text-color);                  /* Dark text */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#text-input::placeholder {
    color: var(--secondary-color);
    opacity: 0.8; /* Slightly less faint placeholder */
}

#text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus-glow);
}

#analyze-button {
    display: block;
    width: 100%;
    padding: 14px 25px;
    background-color: var(--primary-color);
    color: #ffffff; /* White text on blue */
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

#analyze-button:hover:not(:disabled) {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2); /* Blue shadow on hover */
}

#analyze-button:active:not(:disabled) {
     transform: translateY(0px);
}


#analyze-button:disabled {
    background-color: #ced4da; /* Light gray background for disabled */
    color: var(--secondary-color); /* Medium gray text */
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Loading & Error --- */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    margin-bottom: 25px;
    background-color: #e9ecef; /* Light gray background */
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--secondary-color); /* Medium gray text */
    font-weight: 500;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1); /* Light transparent border */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary-color); /* Blue spinner segment */
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    /* Standard light theme error colors */
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 18px 20px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* --- Results Area --- */
.results-area {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

.results-area h2 {
    text-align: center;
    margin-bottom: 35px;
    color: var(--heading-color);
    font-weight: 600;
    font-size: 1.6em;
}

.result-card {
    background-color: var(--card-background); /* White card */
    padding: 25px 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.result-card:hover {
     transform: translateY(-3px);
     box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* Slightly stronger shadow on hover */
}

.result-card h3 {
    color: var(--heading-color); /* Dark heading */
    margin-bottom: 18px;
    font-size: 1.25em;
    font-weight: 600;
    border-bottom: 1px solid #eee; /* Lighter border under heading */
    padding-bottom: 12px;
    position: relative;
    padding-left: 30px;
    display: flex;
    align-items: center;
}

/* --- Icon Placeholder Styling (using theme colors) --- */
.result-card h3::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-80%);
    background-color: var(--secondary-color); /* Default icon color */
}

/* Specific "Icon" Placeholders by card type */
#summary-card h3::before { background-color: var(--primary-color); }
.sentiment-card h3::before { background-color: var(--warning-color); }
.readability-card h3::before { background-color: var(--info-color); }
#keywords-card h3::before { background-color: var(--success-color); }
#complex-phrases-card h3::before { background-color: var(--danger-color); }


.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.grid-container .result-card {
    margin-bottom: 0;
}

/* Sentiment specific styling */
.sentiment-text {
    font-weight: 700;
    font-size: 1.15em;
    text-align: center;
    padding: 10px 0;
}
.sentiment-positive { color: var(--success-color); }
.sentiment-negative { color: var(--danger-color); }
.sentiment-neutral { color: var(--secondary-color); }
.sentiment-unknown { color: #6c757d; font-style: italic; }

/* Readability specific styling */
#readability-output {
    font-weight: 600;
    font-size: 1.1em;
    text-align: center;
    padding: 10px 0;
}


/* Tags styling */
.tag-list {
    list-style: none;
    padding: 5px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-list li {
    background-color: #e9ecef; /* Light gray background for tags */
    color: var(--secondary-color); /* Medium gray text */
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.tag-list li:hover {
    background-color: #dde6ed; /* Slightly darker gray on hover */
    color: var(--heading-color); /* Darker text on hover */
}

/* Complex phrases styling */
#complex-phrases-output {
    list-style: disc;
    padding-left: 25px;
    margin-top: 5px;
}

#complex-phrases-output li {
    margin-bottom: 8px;
    color: var(--text-color); /* Use standard text color */
}
#complex-phrases-output li::marker {
    color: var(--primary-color); /* Blue list bullet */
}


.placeholder-text {
    color: var(--secondary-color);
    font-style: italic;
    opacity: 0.8;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--secondary-color);
}

footer p {
    opacity: 0.9;
}

/* Specific "Icon" Placeholder for Mindmap Card */
#mindmap-card h3::before { background-color: #6f42c1; } /* Example: Purple color */

/* Styling for the Mindmap Container */
.mindmap-container {
    min-height: 300px; /* Ensure it has some height */
    max-height: 600px; /* Prevent it from becoming excessively tall */
    overflow: auto;    /* Allow scrolling if map is large */
    background-color: var(--mindmap-bg-color); /* Subtle background */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px; /* Add some padding inside */
    margin-top: 15px; /* Space below the heading */
    display: flex; /* Use flex to center placeholder */
    align-items: center;
    justify-content: center;
}

/* Style for the SVG generated by Markmap (adjust as needed) */
.mindmap-container svg {
    display: block; /* Ensure SVG takes block display */
    width: 100%;   /* Make SVG fill the container width */
    height: auto;  /* Adjust height automatically */
    min-height: 280px; /* Ensure SVG itself has min height */
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .container {
        padding: 30px;
        margin: 20px auto;
    }
    header h1 {
        font-size: 1.9em;
    }
    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
     .result-card h3 {
        font-size: 1.15em;
    }
    .mindmap-container {
        min-height: 250px;
        max-height: 500px;
   }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    .container {
        padding: 20px;
    }
     header h1 {
        font-size: 1.7em;
    }
    .subtitle {
        font-size: 1.05em;
    }
     #text-input {
        min-height: 150px;
    }
    #analyze-button {
        padding: 12px 20px;
        font-size: 1.1em;
    }
    .result-card {
        padding: 20px;
    }
    .result-card h3 {
        padding-left: 25px;
        font-size: 1.1em;
    }
     .result-card h3::before {
        width: 16px;
        height: 16px;
    }
    .tag-list li {
        padding: 5px 12px;
        font-size: 0.85em;
    }
    .mindmap-container {
        min-height: 200px;
        max-height: 400px;
    }
}
