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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Required asterisk styling */
.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-current {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: space-between;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.lang-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.lang-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 120px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.lang-dropdown.open .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.lang-option:hover {
    background-color: #f8f9fa;
}

.lang-option.active {
    background-color: #667eea;
    color: white;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 30px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 14px 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
}

.tab-btn:first-child {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn:last-child {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Weekly Form Styles */
.weekly-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.weekly-form-header h3 {
    color: #495057;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.weekly-form-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.weekly-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

.weekly-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    font-size: 1.2rem;
    padding: 18px 45px;
}

.weekly-btn:hover {
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

/* Weekly Results Styles */
.weekly-results {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.weekly-header {
    text-align: center;
    margin-bottom: 30px;
}

.weekly-header h3 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.weekly-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
}

/* Weekly Grid Container */
.weekly-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Day Card Styles */
.day-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.day-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

.day-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.day-theme {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.day-content {
    margin-bottom: 15px;
}

.post-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    min-height: 120px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 0.95rem;
    color: #495057;
    margin-bottom: 10px;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 15px;
    background: #d4edda;
    color: #155724;
}

.char-count.warning {
    background: #fff3cd;
    color: #856404;
}

.char-count.danger {
    background: #f8d7da;
    color: #721c24;
}

.day-actions {
    display: flex;
    gap: 10px;
}

.day-copy-btn,
.day-regenerate-btn {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.day-copy-btn:hover,
.day-regenerate-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.day-regenerate-btn {
    border-color: #28a745;
    color: #28a745;
}

.day-regenerate-btn:hover {
    background: #28a745;
    color: white;
}

/* Weekly Actions */
.weekly-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 2px solid #f8f9fa;
}

.weekly-copy-all {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.05rem;
}

.weekly-copy-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.export-btn {
    background: linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.05rem;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 126, 20, 0.3);
}

/* Loading State for Day Cards */
.day-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.day-card.loading .post-preview {
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.day-card.loading .post-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Special input fields styling */
.restaurant-name,
.target-customer,
.restaurant-characteristics {
    grid-column: 1 / -1; /* Full width */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.restaurant-name label,
.target-customer label,
.restaurant-characteristics label {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 700;
}

.restaurant-name-input,
.target-customer-input,
.restaurant-characteristics-input {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
    border: 2px solid #ced4da !important;
    background: white !important;
}

.restaurant-name-input:focus,
.target-customer-input:focus,
.restaurant-characteristics-input:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.form-help {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Image Upload Field */
.image-upload {
    grid-column: 1 / -1; /* Full width */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.image-upload label {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 700;
}

.image-input {
    padding: 12px 16px !important;
    border: 2px solid #ced4da !important;
    border-radius: 8px !important;
    background: white !important;
    cursor: pointer;
}

.image-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.image-preview {
    margin-top: 15px;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #28a745;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.remove-image-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Form Styles */
.post-form {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group select,
.form-group input {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.other-input {
    margin-top: 10px;
    border-color: #ffd700 !important;
    background-color: #fffdf0;
}

.other-input:focus {
    border-color: #ffb700 !important;
    box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.1) !important;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.results-section h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.platform-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #666;
}

/* Post Carousel */
.post-carousel {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.carousel-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

.carousel-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: scale(1.05);
}

.carousel-btn:disabled {
    background: #ced4da;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-indicator {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    min-width: 60px;
    text-align: center;
}

.carousel-content {
    position: relative;
    overflow: hidden;
}

.generated-content {
    background: white;
    border: none;
    border-radius: 0;
    padding: 25px;
    margin-bottom: 0;
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: opacity 0.3s ease;
}

.generated-content.fade-out {
    opacity: 0.3;
}

/* Remove old styling that's no longer needed */
.usage-tip {
    display: none !important;
}

/* Keyboard navigation hint */
.post-carousel {
    position: relative;
}

.post-carousel:hover::after {
    content: "Use ← → arrow keys to navigate";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #6c757d;
    background: rgba(248, 249, 250, 0.95);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    white-space: nowrap;
    z-index: 10;
}

@media (max-width: 768px) {
    .post-carousel:hover::after {
        display: none;
    }
}

/* Style for multiple post options */
.generated-content strong {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.generated-content::selection {
    background: #667eea;
    color: white;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.copy-btn,
.regenerate-btn {
    padding: 12px 25px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.copy-btn:hover,
.regenerate-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .weekly-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .post-form {
        padding: 25px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .generate-btn {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .copy-btn,
    .regenerate-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .carousel-header {
        padding: 10px 15px;
    }
    
    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .page-indicator {
        font-size: 0.85rem;
        min-width: 50px;
    }
    
    /* Tab navigation mobile */
    .tab-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Weekly grid mobile */
    .weekly-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .day-card {
        padding: 15px;
    }
    
    .day-header h4 {
        font-size: 1.1rem;
    }
    
    .post-preview {
        min-height: 100px;
        max-height: 120px;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .weekly-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .weekly-copy-all,
    .export-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .weekly-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    
    .lang-current {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .lang-options {
        min-width: 100px;
    }
    
    .lang-option {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
        margin-right: 90px; /* Avoid overlap with language switcher */
    }
    
    .post-form {
        padding: 20px;
    }
    
    .platform-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .carousel-header {
        padding: 8px 12px;
    }
    
    .generated-content {
        padding: 20px;
        font-size: 0.95rem;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .weekly-form-header {
        padding: 15px;
    }
    
    .weekly-form-header h3 {
        font-size: 1.5rem;
    }
    
    .day-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .day-theme {
        align-self: flex-end;
    }
}