/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #F7FFF7 0%, #4ECDC4 100%);
    min-height: 100vh;
    color: #1A535C;
    line-height: 1.6;
    position: relative;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(26, 83, 92, 0.15) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26, 83, 92, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    color: #1A535C;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    color: #4ECDC4;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26, 83, 92, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #1A535C;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 80px;
}

.nav-btn:hover {
    background: rgba(78, 205, 196, 0.1);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #4ECDC4;
    color: white;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.nav-btn i {
    font-size: 1.2rem;
}

/* Main Content */
.main {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Generator Section */
.prompt-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prompt-display {
    background: linear-gradient(135deg, #F7FFF7 0%, rgba(255, 230, 109, 0.1) 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(78, 205, 196, 0.3);
    position: relative;
    overflow: hidden;
}

.prompt-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(78, 205, 196, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.prompt-display.generating::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.prompt-text {
    text-align: center;
    z-index: 2;
    position: relative;
}

.prompt-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #1A535C;
    margin-bottom: 1rem;
}

.prompt-text .prompt-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.prompt-tag {
    background: rgba(78, 205, 196, 0.2);
    color: #1A535C;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 48px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4ECDC4 0%, #FFE66D 100%);
    color: #1A535C;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #1A535C;
    border: 2px solid rgba(78, 205, 196, 0.3);
    padding: 0.75rem;
    width: 48px;
    height: 48px;
    justify-content: center;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(78, 205, 196, 0.1);
    border-color: #4ECDC4;
    transform: translateY(-2px);
}

.btn-favorite {
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
    border: 2px solid rgba(255, 107, 107, 0.3);
    padding: 0.75rem;
    width: 48px;
    height: 48px;
    justify-content: center;
}

.btn-favorite:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.2);
    border-color: #FF6B6B;
    transform: translateY(-2px);
}

.btn-favorite.active {
    background: #FF6B6B;
    color: white;
}

.btn-favorite.active i {
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Favorites Section */
.favorites-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.favorites-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1A535C;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.favorite-item {
    background: rgba(255, 230, 109, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    border-left: 4px solid #FFE66D;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.favorite-content {
    margin-bottom: 1rem;
}

.favorite-content p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.favorite-note {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.favorite-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-date {
    font-size: 0.8rem;
    color: #888;
}

.btn-delete {
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: scale(1.05);
}

.empty-favorites {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.empty-favorites i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Settings Section */
.settings-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.settings-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1A535C;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1A535C;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 12px;
    background: white;
    color: #1A535C;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* FAQ Section */
.faq-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.faq-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1A535C;
}

.faq-item {
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    margin-bottom: 1rem;
}

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

.faq-question:hover {
    color: #4ECDC4;
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

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

.faq-answer {
    padding: 0 0 1rem 0;
    color: #666;
    line-height: 1.6;
    animation: fadeInDown 0.3s ease-in-out;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-in-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
}

.modal-header h3 {
    color: #1A535C;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #FF6B6B;
}

.modal-body {
    padding: 2rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1A535C;
}

.modal-body textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(78, 205, 196, 0.2);
    justify-content: flex-end;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1A535C;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #4ECDC4;
    color: #1A535C;
}

.toast.error {
    background: #FF6B6B;
    color: white;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(26, 83, 92, 0.1);
    color: #1A535C;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        gap: 0.25rem;
        padding: 0.75rem;
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
    
    .main {
        padding: 1rem;
    }
    
    .prompt-container,
    .favorites-container,
    .settings-container,
    .faq-container {
        padding: 1.5rem;
    }
    
    .prompt-display {
        padding: 1.5rem;
        min-height: 150px;
    }
    
    .prompt-text p {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        gap: 0.25rem;
    }
    
    .btn-secondary,
    .btn-favorite {
        width: 44px;
        height: 44px;
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem 0.75rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .nav-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
        min-width: 60px;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
    
    .prompt-container,
    .favorites-container,
    .settings-container,
    .faq-container {
        padding: 1rem;
    }
    
    .prompt-display {
        padding: 1rem;
        min-height: 120px;
    }
    
    .prompt-text p {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Loading Animation */
@keyframes cardShuffle {
    0% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    50% { transform: translateX(10px) rotate(5deg); }
    75% { transform: translateX(-5px) rotate(-2deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.prompt-display.generating {
    animation: cardShuffle 0.6s ease-in-out;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-text {
    background: linear-gradient(-45deg, #1A535C, #4ECDC4, #FFE66D, #FF6B6B);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}
