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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro', 'Segoe UI', Roboto, sans-serif;
    background-color: #0F172A;
    color: #F1F5F9;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
    padding-top: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1rem;
    color: #94A3B8;
    font-weight: 400;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1E293B;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #334155;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #6366F1;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F1F5F9;
}

.user-credits {
    font-size: 0.8rem;
    color: #94A3B8;
}

.auth-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-btn.primary {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: #fff;
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.auth-btn.secondary {
    background: #334155;
    color: #F1F5F9;
}

.auth-btn.secondary:hover {
    background: #475569;
}

.support-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #6366F1;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-btn:hover {
    background: #8B5CF6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.usage-bar {
    background: #1E293B;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.usage-info {
    font-size: 0.9rem;
}

#usage-text {
    color: #94A3B8;
}

.purchase-section {
    display: flex;
    gap: 10px;
}

.purchase-btn {
    padding: 8px 16px;
    background: #6366F1;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.purchase-btn:hover {
    background: #8B5CF6;
    transform: translateY(-2px);
}

.input-section {
    background: #1E293B;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid #334155;
}

.form-group {
    margin-bottom: 28px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #F1F5F9;
}

textarea {
    width: 100%;
    padding: 16px;
    background: #0F172A;
    border: 2px solid #334155;
    border-radius: 12px;
    color: #F1F5F9;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea::placeholder {
    color: #64748B;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: #64748B;
    margin-top: 8px;
}

.platform-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.platform-btn {
    padding: 12px 16px;
    background: #0F172A;
    border: 2px solid #334155;
    border-radius: 10px;
    color: #F1F5F9;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.platform-btn:hover {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.1);
}

.platform-btn.active {
    background: #6366F1;
    border-color: #6366F1;
    color: #fff;
}

.style-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.style-btn {
    padding: 12px 16px;
    background: #0F172A;
    border: 2px solid #334155;
    border-radius: 10px;
    color: #F1F5F9;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.style-btn:hover {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.1);
}

.style-btn.active {
    background: #6366F1;
    border-color: #6366F1;
    color: #fff;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #334155;
    border-radius: 13px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F1F5F9;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #6366F1;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.95rem;
    color: #F1F5F9;
}

.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    margin-top: 28px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-btn.loading .btn-text {
    opacity: 0;
}

.generate-btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.results-section {
    margin-bottom: 24px;
}

.results-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #F1F5F9;
}

.captions-container {
    display: grid;
    gap: 16px;
}

.caption-card {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.caption-card:hover {
    border-color: #6366F1;
    transform: translateY(-2px);
}

.caption-text {
    color: #F1F5F9;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 16px;
    word-wrap: break-word;
}

.copy-btn {
    padding: 8px 16px;
    background: #6366F1;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.copy-btn:hover {
    background: #8B5CF6;
}

.copy-btn.copied {
    background: #10B981;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #EF4444;
    border-radius: 12px;
    padding: 16px 20px;
    color: #EF4444;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10B981;
    color: #10B981;
}

.caption-char-count {
    font-size: 0.8rem;
    color: #64748B;
    margin-bottom: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1E293B;
    border-radius: 16px;
    border: 1px solid #334155;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: #F1F5F9;
}

.modal-close {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 24px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pricing-card {
    background: #0F172A;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}

.pricing-card:hover {
    border-color: #6366F1;
    transform: translateY(-4px);
}

.pricing-card h3 {
    font-size: 1.2rem;
    color: #F1F5F9;
    margin-bottom: 16px;
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 700;
    color: #6366F1;
    margin-bottom: 20px;
}

.pricing-card ul {
    list-style: none;
    margin-bottom: 24px;
    text-align: left;
}

.pricing-card ul li {
    padding: 8px 0;
    color: #94A3B8;
    font-size: 0.9rem;
    border-bottom: 1px solid #334155;
}

.pricing-card ul li:last-child {
    border-bottom: none;
}

.purchase-action-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.purchase-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .auth-section {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .usage-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .purchase-section {
        width: 100%;
        justify-content: center;
    }
    
    .input-section {
        padding: 24px;
    }
    
    .style-selector {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .style-btn {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.page-footer {
    margin-top: 60px;
    padding: 32px 0;
    border-top: 1px solid #334155;
    text-align: center;
}

.page-footer p {
    color: #64748B;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #6366F1;
}

.legal-content {
    background: #1E293B;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid #334155;
}

.legal-content section {
    margin-bottom: 32px;
}

.legal-content section:last-child {
    margin-bottom: 0;
}

.legal-content h2 {
    font-size: 1.4rem;
    color: #F1F5F9;
    margin-bottom: 12px;
    font-weight: 600;
}

.legal-content p {
    color: #94A3B8;
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul {
    list-style: disc;
    margin-left: 24px;
    color: #94A3B8;
    line-height: 1.8;
}

.legal-content ul li {
    margin-bottom: 8px;
}

.legal-content a {
    color: #6366F1;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.update-date {
    color: #64748B;
    font-style: italic;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .legal-content {
        padding: 24px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}
