/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #fafafa;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #718096;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #1a202c;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #1a202c;
    border-radius: 1px;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    padding: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mobile adjustments for hero */
@media (max-width: 640px) {
    .hero-title {
        font-size: 1.5rem;
    }
}

.theme-display {
    padding: 1.5rem 2rem;
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff5f7 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    margin: 0 auto;
}

.theme-label {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.theme-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.3;
}

/* Line Number Label */
.line-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Story Section */
.story-section {
    background: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 4rem;
    border: none;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.last-sentence-container {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.line-number-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.last-sentence {
    background: none;
    border-radius: 0;
    padding: 0;
    border: none;
}

.sentence-text {
    font-size: 1.375rem;
    font-weight: 500;
    color: #1a202c;
    line-height: 1.6;
    letter-spacing: -0.01em;
    padding: 1.5rem 0;
    border-left: 3px solid #e2e8f0;
    padding-left: 1.5rem;
    margin-left: 0;
}

/* Input Section */
.input-container {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    font-size: 1.125rem;
    font-weight: 500;
    color: #1a202c;
    margin-bottom: 1rem;
}

.sentence-input {
    width: 100%;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.125rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.sentence-input:focus {
    outline: none;
    border-color: #1a202c;
    box-shadow: 0 0 0 3px rgba(26, 32, 44, 0.1);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.word-count {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.submit-btn {
    background: #1a202c;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-help {
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Submission Status */
.submission-status {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
}

.submission-preview {
    margin-bottom: 2.5rem;
}

.preview-line {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f7fafc;
}

.preview-line.highlight {
    background: linear-gradient(135deg, #f0f4ff 0%, #fff0f5 100%);
    border: 2px solid #e2e8f0;
}

.preview-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1a202c;
    margin: 0;
}

.status-message {
    text-align: center;
    padding: 2rem 0 1rem;
}

.status-message h3 {
    color: #22543d;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.status-message p {
    color: #2f855a;
    font-size: 0.875rem;
}


/* Archive */
.archive-header {
    text-align: center;
    margin-bottom: 5rem;
}

/* Admin Panel */
.admin-header {
    text-align: center;
    margin-bottom: 4rem;
}

.admin-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: #1a202c;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.admin-subtitle {
    font-size: 1.125rem;
    color: #718096;
    font-weight: 500;
}

.admin-sections {
    display: grid;
    gap: 3rem;
}

.admin-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-value {
    font-size: 1.125rem;
    color: #1a202c;
    font-weight: 600;
}

.theme-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group label {
    font-size: 1rem;
    font-weight: 500;
    color: #1a202c;
}

.theme-input {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.theme-input:focus {
    outline: none;
    border-color: #1a202c;
}

.theme-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #1a202c;
    color: white;
}

.admin-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

.admin-btn.secondary {
    background: #718096;
}

.admin-btn.secondary:hover {
    background: #4a5568;
}

.admin-btn.primary {
    background: #38a169;
}

.admin-btn.primary:hover {
    background: #2f855a;
}

.admin-btn.warning {
    background: #ed8936;
}

.admin-btn.warning:hover {
    background: #dd6b20;
}

.admin-btn.danger {
    background: #e53e3e;
}

.admin-btn.danger:hover {
    background: #c53030;
}

.submissions-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.submission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.submission-item:last-child {
    border-bottom: none;
}

.submission-content {
    flex: 1;
    font-size: 1rem;
    color: #1a202c;
}

.submission-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #718096;
}

.daily-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: #1a202c;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.archive-subtitle {
    font-size: 1.125rem;
    color: #718096;
    font-weight: 500;
}

.archive-list {
    display: grid;
    gap: 2rem;
}

.archive-item {
    background: none;
    border-radius: 0;
    padding: 3rem 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.archive-item-meta {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 2rem;
    font-weight: 500;
}

.archive-story-content {
    font-size: 1.125rem;
    color: #2d3748;
    line-height: 1.8;
    white-space: pre-wrap;
    max-width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.01em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
    color: #1a202c;
    background: #f1f5f9;
}

.modal-body {
    padding: 2rem;
}

.story-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.story-content {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #1a202c;
    margin-bottom: 2rem;
}

.story-credits {
    font-size: 0.875rem;
    color: #718096;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
    
    .header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 3rem 0 2rem;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .submit-btn {
        width: 100%;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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