/* --- General Body and Layout Styling --- */
body {
    /* Use a system font stack for a native look and feel across different OS. */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 2rem;
    /* Flexbox is used to center the main content container vertically and horizontally. */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* The main content box. */
.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth. */
    width: 100%;
    max-width: 600px; /* Prevents the container from becoming too wide on large screens. */
}

h1, h2 {
    color: #1a1a1a;
}

/* --- Form Element Styling --- */
input[type="url"], input[type="password"] {
    /* Make inputs take up the full width of their container, accounting for padding. */
    width: calc(100% - 22px); 
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    background-color: #007bff; /* A standard blue for primary actions. */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s; /* Smooth transition for hover effects. */
}

button:hover {
    background-color: #0056b3; /* A darker shade on hover. */
}

/* --- Specific Component Styling --- */

/* A flex container for the "Read" and "Listen" buttons. */
.button-group {
    display: flex;
    gap: 10px; /* Adds space between the buttons. */
}

/* Allows the action buttons to grow and fill the available space equally. */
.action-button {
    flex-grow: 1;
}

/* Special styling for the "Listen" (mp3) button. */
.action-button[data-action="mp3"] {
    background-color: #28a745; /* Green for a different type of action. */
}

.action-button[data-action="mp3"]:hover {
    background-color: #218838;
}

/* The container for the successful result link. */
#result {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #e9f7ef; /* A light green to indicate success. */
    border-left: 5px solid #28a745; /* A colored left border for emphasis. */
}

#result a {
    color: #0056b3;
    word-break: break-all; /* Ensures long URLs don't break the layout. */
}

.new-paragraph-button {
    margin-top: 1rem;
}

/* Styling for error messages. */
.error-message {
    color: #721c24; /* Dark red text. */
    background-color: #f8d7da; /* Light red background. */
    border: 1px solid #f5c6cb;
    padding: .75rem 1.25rem;
    margin-top: 1rem;
    border-radius: .25rem;
}

/* A simple horizontal rule for separating content sections. */
hr {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 2rem 0;
}

/* --- Footer Styling --- */
footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
}

/* --- Settings Icon Styling --- */
.settings-icon {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.settings-icon:hover {
    transform: scale(1.1) rotate(45deg);
}

.settings-icon a {
    text-decoration: none;
    color: #333;
}