/* 
 * AI Poetry Plugin CSS
 * Version: 3.0 - Modern Refresh
 */

.ai-poetry-container {
    min-height: 100vh;
    padding: 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1b23;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.ai-poetry-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.ai-poetry-card {
    max-width: 850px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 3rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ai-poetry-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.ai-poetry-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-poetry-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.ai-poetry-subtitle {
    color: #64748b;
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.ai-poetry-form {
    margin-bottom: 2.5rem;
}

.ai-poetry-topic-section {
    margin-bottom: 2rem;
}

.ai-poetry-topic-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    color: #374151;
}

.ai-poetry-topic-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.ai-poetry-topic-row input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-poetry-topic-row input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ai-poetry-sample-btn {
    background-color: #f8fafc;
    color: #6366f1;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-size: 0.95rem;
}

.ai-poetry-sample-btn:hover {
    background-color: #6366f1;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-poetry-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .ai-poetry-options {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .ai-poetry-card {
        padding: 2rem;
    }

    .ai-poetry-title {
        font-size: 2.25rem;
    }
}

.ai-poetry-option-group {
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.ai-poetry-option-group:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-poetry-option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #374151;
}

.ai-poetry-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ai-poetry-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.ai-poetry-radio:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.ai-poetry-radio input[type="radio"] {
    cursor: pointer;
    margin: 0;
    width: 20px;
    height: 20px;
    accent-color: #6366f1;
}

.ai-poetry-radio-label {
    font-size: 0.95rem;
    color: #4b5563;
}

.ai-poetry-option-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 1 1 .708-.708L8 10.293l3.646-3.647a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 8 11.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
    padding-right: 3rem;
    transition: all 0.2s ease;
}

.ai-poetry-option-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-poetry-submit {
    text-align: center;
    margin-top: 2.5rem;
}

.ai-poetry-generate-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-poetry-generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.ai-poetry-generate-btn:hover::before {
    left: 100%;
}

.ai-poetry-generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}

.ai-poetry-generate-btn:active {
    transform: translateY(-1px);
}

.ai-poetry-generate-btn:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.ai-poetry-result {
    margin-top: 2.5rem;
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-poetry-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-poetry-result-header label {
    font-weight: 700;
    font-size: 1.125rem;
    color: #374151;
}

.ai-poetry-actions {
    display: flex;
    gap: 0.75rem;
}

.ai-poetry-action-btn {
    background-color: #f1f5f9;
    color: #6366f1;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.ai-poetry-action-btn:hover {
    background-color: #6366f1;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.ai-poetry-result textarea {
    width: 100%;
    height: 280px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    background-color: #fefefe;
    transition: all 0.2s ease;
    font-family: 'Georgia', serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-poetry-result textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Enhanced loading animation */
@keyframes breathe {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.generating {
    animation: breathe 2s infinite ease-in-out;
}

/* Enhanced mobile experience */
@media (max-width: 480px) {
    .ai-poetry-container {
        padding: 1rem;
    }

    .ai-poetry-topic-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ai-poetry-sample-btn {
        width: 100%;
    }

    .ai-poetry-radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ai-poetry-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Custom scrollbar with modern styling */
.ai-poetry-result textarea::-webkit-scrollbar {
    width: 10px;
}

.ai-poetry-result textarea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

.ai-poetry-result textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ai-poetry-result textarea::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Focus-within styles for better accessibility */
.ai-poetry-option-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}