/* == Full Screen Text Modal == */
.modal-overlay {
    position: fixed; /* Stay in place */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    z-index: 1000; /* Sit on top */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    overflow-y: auto; /* Enable scroll if needed */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Auto margin helps centering */
    padding: 30px;
    border: 1px solid #888;
    width: 85%; /* Could be more or less, depending on screen size */
    max-width: 900px; /* Max width */
    min-height: 70%; /* Minimum height */
    max-height: 90vh; /* Max height relative to viewport */
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative; /* For positioning the close button */
    display: flex;
    flex-direction: column;
}

.modal-content h3 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#modal-text {
    flex-grow: 1; /* Allow text area to fill space */
    overflow-y: auto; /* Scroll within the text area if needed */
    margin-top: 15px;
}

/* Ensure markdown content within modal is styled */
#modal-text.markdown-content {
    white-space: normal;
    word-wrap: break-word;
    /* Add any other necessary markdown styles here or ensure global ones apply */
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: black;
    text-decoration: none;
}

/* Style for the button in the table */
.evaluation-table .view-full-text-btn {
    margin-top: 8px;
    display: block; /* Make it block to appear below preview */
}

.submission-text-preview {
    /* Optional: Add styling for the preview if needed */
    color: #555;
    font-size: 0.9em;
}

/* Duelo de Plumas - Modern Literary Contest Platform */
/* Based on UI Parameters from app/config/ui_parameters.py */

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #35302a;
    background-color: #f7f5f0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: #5e6b4c;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #44513a;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #35302a;
    line-height: 1.3;
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

/* Layout */
header {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 24px;
    background-color: #f7f5f0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0d8c9;
}

header nav {
    max-width: 1120px;
    margin: 0 auto;
}

main,
footer {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px;
}

main {
    flex-grow: 1;
    padding-top: 90px; /* Add padding to account for fixed header */
    padding-bottom: 48px;
}

/* Remove the header bottom margin and border since it's now fixed */
header {
    margin-bottom: 0;
}

footer {
    border-top: 1px solid #e0d8c9;
    margin-top: 24px;
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: #665e54;
}

/* Navigation */
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
}

header nav h1 {
    margin: 0;
    font-size: 1.8rem;
}

header nav h1 a {
    color: #5e6b4c;
    transition: color 0.2s ease;
}

header nav h1 a:hover {
    color: #44513a;
}

header nav a {
    font-weight: 600;
    padding: 8px 0;
    position: relative;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #5e6b4c;
    transition: width 0.2s ease;
}

header nav a:hover::after {
    width: 100%;
}

/* Mobile Navigation - Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 20;
    position: relative;
    top: -5px;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #5e6b4c;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1.5;
    color: #35302a;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #e0d8c9;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: 18px;
    font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    color: #35302a;
    background-color: #fff;
    border-color: #a07d41;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(160, 125, 65, 0.25);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #35302a;
}

/* Textarea height */
textarea {
    min-height: 120px;
    resize: vertical;
}

/* Alerts */
.flash-messages {
    margin-bottom: 24px;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-weight: 500;
}

.alert-info {
    background-color: #eef2f5;
    color: #607b8d;
    border-left: 4px solid #607b8d;
}

.alert-success {
    background-color: #eef3ea;
    color: #6b8e4e;
    border-left: 4px solid #6b8e4e;
}

.alert-warning {
    background-color: #f8f1e0;
    color: #c9a459;
    border-left: 4px solid #c9a459;
}

.alert-danger {
    background-color: #f6e9e8;
    color: #a3423c;
    border-left: 4px solid #a3423c;
}

/* Contest Cards and Lists */
.contests-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.page-title {
    margin-bottom: 32px;
    font-size: 2rem;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0d8c9;
}

.section-divider {
    margin: 32px 0;
    border: none;
    height: 1px;
    background-color: #e0d8c9;
}

.contest-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #5e6b4c;
    font-weight: 700;
    position: relative;
    padding-bottom: 8px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #5e6b4c;
}

.no-contests {
    padding: 24px;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    color: #665e54;
    font-style: italic;
}

.contest-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.contest-item {
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.contest-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.private-contest {
    border-top: 3px solid #a07d41;
}

.contest-header {
    padding: 24px 24px 16px;
}

.contest-title {
    font-size: 1.3rem;
    margin: 0;
    line-height: 1.4;
}

.contest-title a {
    color: #35302a;
    transition: color 0.2s ease;
}

.contest-title a:hover {
    color: #5e6b4c;
}

.private-badge {
    display: inline-block;
    background-color: #a07d41;
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}

.contest-description {
    padding: 0 24px 16px;
    color: #665e54;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.contest-meta {
    padding: 16px 24px;
    background-color: #f9f7f3;
    border-top: 1px solid #e0d8c9;
    font-size: 0.9rem;
    color: #665e54;
}

.meta-date {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.meta-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.meta-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-stat i {
    color: #5e6b4c;
}

.contest-results {
    padding: 16px 24px;
    background-color: #f2f5ec;
    border-top: 1px solid #dce6d0;
}

.result-item {
    margin-bottom: 8px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.rank {
    font-weight: 700;
    color: #5e6b4c;
}

.submission-title {
    font-style: italic;
}

.submission-author {
    font-size: 0.9rem;
    color: #665e54;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
    margin-right: 8px;
}

.status-indicator.open {
    background-color: #eef3ea;
    color: #6b8e4e;
}

.status-indicator.open::before {
    content: "🟢";
    margin-right: 4px;
}

.status-indicator.evaluation {
    background-color: #f8f1e0;
    color: #c9a459;
}

.status-indicator.evaluation::before {
    content: "🟠";
    margin-right: 4px;
}

.status-indicator.closed {
    background-color: #f6e9e8;
    color: #a3423c;
}

.status-indicator.closed::before {
    content: "🔴";
    margin-right: 4px;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 48px;
    padding: 48px 24px;
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hero h1 {
    font-size: 2.5rem;
    color: #5e6b4c;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.2rem;
    color: #665e54;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Buttons */
.button, 
a.button,
button[type="submit"],
input[type="submit"] {
    display: inline-block;
    background-color: #5e6b4c;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
}

.button:hover, 
a.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background-color: #44513a;
    color: white;
    text-decoration: none;
}

.button-small {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* Secondary button style */
.button-secondary {
    background-color: #a07d41;
}

.button-secondary:hover {
    background-color: #8a6b38;
}

/* AI button style */
.button-ai {
    background-color: #a07d41;
    color: white;
}

.button-ai:hover {
    background-color: #8a6b38;
}

/* AI pending section */
.ai-pending h3 {
    color: #a07d41;
}

.ai-pending h3 i {
    margin-right: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header nav {
        position: relative;
    }
    
    /* Show hamburger menu */
    .hamburger-menu {
        display: flex;
    }
    
    /* Adjust header title layout for mobile */
    header nav h1 {
        display: flex;
        align-items: center;
        font-size: 1.5rem;
    }
    
    /* Hide the normal navigation */
    header nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 16px;
        z-index: 10;
        border-radius: 4px;
        margin-top: 8px;
    }
    
    /* When menu is open */
    header nav.menu-open ul {
        display: flex;
    }
    
    /* Hamburger animation */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    header nav ul li {
        width: 100%;
    }

    header nav a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #e0d8c9;
    }
    
    header nav li:last-child a {
        border-bottom: none;
    }
    
    header nav a::after {
        display: none;
    }

    .contest-list {
        grid-template-columns: 1fr;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on mobile */
    }
}

/* Admin Table Specific Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

.admin-table th, .admin-table td {
    border: 1px solid #e0d8c9;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background-color: #f9f7f3;
    color: #35302a;
    font-weight: bold;
}

.admin-table tr:nth-child(even) {
    background-color: #fafaf8;
}

.admin-table tr:hover {
    background-color: #f7f5f0;
}

.admin-table td a {
    color: #5e6b4c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.admin-table td a:hover {
    color: #44513a;
    text-decoration: underline;
}

/* Specific column alignments if needed */
.admin-table .actions-column {
    text-align: center;
    white-space: nowrap;
}

.admin-table .type-column {
    white-space: nowrap;
}

.admin-table .status-apply-button {
    margin-left: 5px;
    padding: 3px 6px;
    vertical-align: middle;
    color: #5e6b4c;
}

.admin-table .small-select {
    padding: 4px 8px;
    vertical-align: middle;
    border: 1px solid #e0d8c9;
    border-radius: 4px;
}

.admin-table .inline-form {
    display: flex;
    align-items: center;
}

/* Ensure icons in actions are spaced slightly */
.admin-table .actions-column .button-icon {
    margin: 0 3px;
    color: #5e6b4c;
}

/* Style for past dates */
.admin-table td.date-past {
    color: #a3423c;
    font-style: italic;
}

/* Action Buttons within the table */
.admin-table .actions-column a,
.admin-table .actions-column button {
    padding: 6px 10px;
    font-size: 0.9em;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}

.admin-table .actions-column form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.admin-table .actions-column a.button-small,
.admin-table .actions-column button.button-small {
    background-color: #5e6b4c;
    color: white;
    border: 1px solid #5e6b4c;
}

.admin-table .actions-column a.button-small:hover,
.admin-table .actions-column button.button-small:hover {
    background-color: #44513a;
    border-color: #44513a;
    text-decoration: none;
}

.admin-table .actions-column button.button-danger {
    background-color: #a3423c;
    border-color: #8c3833;
    color: white;
}

.admin-table .actions-column button.button-danger:hover {
    background-color: #8c3833;
    border-color: #74302c;
}

/* Status Change Form within table */
.admin-table .inline-form {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-start;
    margin: 0;
}

.admin-table .small-select {
    padding: 5px 8px;
    border: 1px solid #e0d8c9;
    border-radius: 3px;
    font-size: 0.9em;
    flex-grow: 1;
    min-width: 100px;
}

/* Apply button specific styling (within inline form) */
.admin-table .inline-form .status-apply-button {
    padding: 4px 6px;
    font-size: 1em;
    color: #5e6b4c;
    background-color: transparent;
    border: none;
}

.admin-table .inline-form .status-apply-button:hover {
    color: #44513a;
}

/* Style for icon buttons */
.admin-table .button-icon {
    padding: 4px 8px;
    font-size: 1.1em;
    line-height: 1;
    background: none;
    border: none;
    color: #665e54;
    cursor: pointer;
    vertical-align: middle;
    transition: color 0.2s ease;
    display: inline-flex; 
    align-items: center;
    justify-content: center;
}

.admin-table .button-icon:hover {
    color: #35302a;
}

.admin-table .button-icon.button-danger {
    background: none;
    border: none;
    color: #a3423c;
}

/* Fix for the SimpleMDE Editor */
.CodeMirror, .CodeMirror-scroll {
    min-height: 200px !important;
    border-color: #e0d8c9;
    border-radius: 4px;
}

.editor-toolbar {
    border-color: #e0d8c9;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.editor-toolbar a {
    color: #5e6b4c !important;
}

.editor-toolbar a:hover {
    color: #44513a !important;
    background-color: #f7f5f0;
}

.editor-toolbar.fullscreen {
    background: #f7f5f0;
}

/* Ensure form buttons are spaced properly */
.form-group {
    margin-bottom: 20px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* Admin AI Evaluation Costs Page CSS removed - no longer needed */

/* ... existing code ... */

/* Quill Pen Styles */
.site-header-quill {
    width: 36px;
    height: 36px;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-block;
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* header nav h1:hover .site-header-quill {
    transform: rotate(10deg);
} */

/* Version tag and changelog */
.version-tag {
    font-size: 0.75rem;
    color: rgba(94, 107, 76, 0.7);
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-block;
    margin-left: 5px;
}

.version-tag:hover {
    color: rgba(94, 107, 76, 1);
    text-decoration: underline;
}

.changelog-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.changelog-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #e0d8c9;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.changelog-title {
    color: #5e6b4c;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d8c9;
}

.changelog-version {
    margin-bottom: 15px;
}

.changelog-version h3 {
    color: #5e6b4c;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.changelog-version ul {
    list-style-type: none;
    padding-left: 20px;
}

.changelog-version ul li {
    margin-bottom: 5px;
    position: relative;
}

.changelog-version ul li::before {
    content: "-";
    position: absolute;
    left: -15px;
}

.changelog-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #665e54;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.changelog-close:hover {
    color: #35302a;
}

.contest-item {
    position: relative;
}

.card-quill {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    opacity: 0.6;
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.contest-item:hover .card-quill {
    transform: rotate(10deg) scale(1.2);
    opacity: 1;
}

@keyframes quillWriting {
    0% {
        transform: rotate(0deg) translateX(0) translateY(0);
    }
    25% {
        transform: rotate(5deg) translateX(-2px) translateY(2px);
    }
    50% {
        transform: rotate(0deg) translateX(0) translateY(0);
    }
    75% {
        transform: rotate(-5deg) translateX(2px) translateY(2px);
    }
    100% {
        transform: rotate(0deg) translateX(0) translateY(0);
    }
}

.contest-item:hover .card-quill {
    animation: quillWriting 1s ease-in-out infinite;
} 