/* AI Poem Generator Styles */

.aipg-container {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.aipg-generator-card {
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.9) 0%,
        rgba(147, 112, 219, 0.85) 25%,
        rgba(173, 216, 230, 0.85) 50%,
        rgba(221, 160, 221, 0.85) 75%,
        rgba(255, 105, 180, 0.9) 100%
    );
    border-radius: 24px;
    padding: 60px;
    box-shadow: 0 20px 60px rgba(138, 43, 226, 0.3);
    position: relative;
    overflow: hidden;
}

.aipg-generator-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: aipgFloat 20s ease-in-out infinite;
}

@keyframes aipgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.aipg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.aipg-title {
    font-size: 36px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0;
    letter-spacing: -0.5px;
}

.aipg-sample-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #6b21a8;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aipg-sample-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.aipg-topic-section {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.aipg-topic-input {
    width: 100%;
    padding: 24px;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    resize: vertical;
    min-height: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.aipg-topic-input::placeholder {
    color: #a0aec0;
}

.aipg-topic-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.aipg-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.aipg-option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aipg-label {
    font-size: 20px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 4px;
}

.aipg-radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.aipg-radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.aipg-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.aipg-radio-label {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.aipg-radio-option input[type="radio"]:checked + .aipg-radio-label {
    background: rgba(255, 255, 255, 1);
    color: #6b21a8;
    border-color: #6b21a8;
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.2);
}

.aipg-radio-label:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.aipg-select {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%234a5568' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.aipg-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.aipg-generate-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.aipg-generate-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    padding: 18px 60px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    min-width: 280px;
    justify-content: center;
}

.aipg-generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
}

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

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

.aipg-btn-icon {
    animation: aipgIconPulse 2s ease-in-out infinite;
}

@keyframes aipgIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.aipg-loading {
    text-align: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.aipg-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: aipgSpin 1s linear infinite;
}

@keyframes aipgSpin {
    to { transform: rotate(360deg); }
}

.aipg-loading-text {
    font-size: 18px;
    color: white;
    font-weight: 500;
    margin: 0;
}

.aipg-result-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 32px;
    margin-top: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    animation: aipgSlideIn 0.5s ease-out;
}

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

.aipg-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.aipg-result-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0;
}

.aipg-result-actions {
    display: flex;
    gap: 12px;
}

.aipg-action-btn {
    background: #6b21a8;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.2);
}

.aipg-action-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.3);
}

.aipg-poem-output {
    font-size: 18px;
    line-height: 1.8;
    color: #2d3748;
    white-space: pre-wrap;
    font-family: 'Georgia', serif;
    padding: 20px;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 12px;
    border-left: 4px solid #6b21a8;
}

.aipg-error {
    background: rgba(254, 226, 226, 0.95);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid #ef4444;
    position: relative;
    z-index: 1;
}

.aipg-error-icon {
    font-size: 32px;
}

.aipg-error-text {
    font-size: 16px;
    color: #991b1b;
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aipg-generator-card {
        padding: 30px 20px;
    }
    
    .aipg-title {
        font-size: 28px;
    }
    
    .aipg-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .aipg-options-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .aipg-generate-btn {
        width: 100%;
        padding: 16px 40px;
        font-size: 18px;
    }
    
    .aipg-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Copy success animation */
.aipg-action-btn.copied {
    background: #10b981 !important;
}

.aipg-action-btn.copied::after {
    content: '✓';
    position: absolute;
    font-size: 14px;
    animation: aipgCheckmark 0.3s ease-out;
}

@keyframes aipgCheckmark {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
