/* Global styles and responsive design rules */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f7fafc; /* Tailwind's gray-100 */
    color: #1a202c; /* Tailwind's gray-800 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

/* General container for forms and content pages */
.main-container {
    width: 100%;
    max-width: 900px;
    margin: 1rem;
}

/* Styling for the header on authenticated pages */
.main-header {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-nav .icon-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.header-nav .icon-button:hover {
    background-color: #edf2f7; /* gray-200 */
}

.header-nav .icon-button img {
    width: 24px;
    height: 24px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-content a, .dropdown-content button {
    color: black;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
}

.dropdown-content .user-email {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0; /* gray-300 */
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568; /* gray-600 */
}


.dropdown-content a:hover, .dropdown-content button:hover {
    background-color: #f7fafc; /* gray-100 */
}

.show {
    display: block;
}

/* Story list and viewer styles */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.story-card {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.story-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2d3748; /* gray-700 */
}

.story-viewer-content p {
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* Utility for loading state */
.hidden {
    display: none !important;
}

.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #4f46e5; /* Indigo-600 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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