:root {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --accent-color: #FFC107;
    --error-color: #F44336;
    --purple-color: #9C27B0;
    --background-color: #f8f6f0;
    --text-color: #333;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.language-toggle {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.content-section.active {
    display: block;
}

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

.welcome-card {
    background: linear-gradient(135deg, var(--card-background), #f0f8ff);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 5px solid var(--primary-color);
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.welcome-card p {
    font-size: 1.1rem;
    color: #666;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.action-btn.secondary {
    background: linear-gradient(135deg, var(--accent-color), #ffeb3b);
    color: var(--text-color);
    border-color: transparent;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.action-btn i {
    font-size: 2rem;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-card.large {
    padding: 2rem;
}

.stat-card.large .stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.generator-controls {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.control-group select,
.control-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary, .btn-secondary, .btn-small {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-color), #ffeb3b);
    color: var(--text-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary:hover, .btn-secondary:hover, .btn-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.prompt-result, .generated-prompt {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--secondary-color);
}

.prompt-text {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
    border-left: 4px solid var(--primary-color);
}

.prompt-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.saved-prompts, .saved-characters, .community-stories {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.prompts-list, .characters-list, .stories-list {
    display: grid;
    gap: 1rem;
}

.prompt-item, .character-item, .story-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.character-generator {
    text-align: center;
    margin-bottom: 2rem;
}

.character-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--purple-color);
}

.character-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.character-form {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.writing-controls {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.word-count {
    font-size: 1.2rem;
    font-weight: 600;
}

.session-buttons {
    display: flex;
    gap: 1rem;
}

.writing-area {
    margin-bottom: 2rem;
}

.writing-area textarea {
    width: 100%;
    min-height: 400px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.writing-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.writing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-chart {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.progress-chart canvas {
    max-width: 100%;
    height: auto;
}

.goals-section {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.goal-setting {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.goal-setting input {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

.community-actions {
    text-align: center;
    margin-bottom: 2rem;
}

.share-form {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.faq-container {
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

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

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: #f8f9fa;
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: #666;
    line-height: 1.8;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 10px;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(33, 150, 243, 0.1);
}

footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.delete-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    transition: opacity 0.3s ease;
}

.delete-btn:hover {
    opacity: 0.8;
}

.like-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.like-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.like-btn.liked {
    color: var(--error-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .writing-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .session-info {
        justify-content: center;
        text-align: center;
    }
    
    .session-buttons {
        justify-content: center;
    }
    
    .writing-actions {
        flex-direction: column;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .goal-setting {
        justify-content: center;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .prompt-actions {
        flex-direction: column;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    main {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .welcome-card {
        padding: 1rem;
    }
    
    .welcome-card h2 {
        font-size: 1.4rem;
    }
    
    .generator-controls,
    .character-form,
    .share-form {
        padding: 1rem;
    }
    
    .timer {
        font-size: 1.5rem;
    }
    
    .writing-area textarea {
        min-height: 300px;
    }
}

/* Print Styles */
@media print {
    .bottom-nav,
    .writing-controls,
    .writing-actions,
    .community-actions,
    .language-toggle {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .content-section {
        display: block !important;
    }
}
