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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-size: 3em;
    font-weight: 800;
    letter-spacing: -1px;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 40px;
    font-size: 1.2em;
    font-weight: 400;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1em;
    letter-spacing: -0.5px;
}

textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #f8fafc;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.optimize-btn {
    display: block;
    width: 250px;
    margin: 0 auto 30px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.optimize-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;
}

.optimize-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.optimize-btn:hover::before {
    left: 100%;
}

.optimize-btn:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    text-align: center;
    color: #667eea;
    font-size: 1.2em;
    margin: 30px 0;
    font-weight: 500;
}

.loading span {
    display: inline-block;
    position: relative;
}

.loading span::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.output-section {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-top: 40px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    animation: slideInUp 0.6s ease-out;
}

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

.output-section h2 {
    color: #10b981;
    margin-bottom: 30px;
    font-size: 1.8em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-section h2::before {
    content: '✓';
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-size: 18px;
}

.output-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #2c3e50;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.output-text strong {
    color: #e74c3c;
    font-weight: 700;
}

.output-text b {
    color: #3498db;
    font-weight: 600;
}

.output-text em {
    color: #9b59b6;
    font-style: italic;
}

.error-message {
    background: linear-gradient(135deg, #fee4e6 0%, #fecaca 100%);
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hidden {
    display: none;
}

.output-item {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.output-item:hover {
    background: #fff;
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
}

.output-item:last-child {
    margin-bottom: 0;
}

.output-item h3 {
    color: #1e293b;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.output-item h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 2px;
}

.copyable-field {
    background-color: #fff;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.95em;
    line-height: 1.7;
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.copyable-field:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.copy-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.copy-btn:active::before {
    width: 300px;
    height: 300px;
}

#seoTitle {
    font-weight: 600;
    color: #2c3e50;
}

#metaDescription {
    color: #555;
}

#keywords {
    color: #3498db;
}

.output-text h1, .output-text h2, .output-text h3 {
    margin: 15px 0 10px 0;
    color: #2c3e50;
}

.output-text h1 {
    font-size: 1.8em;
}

.output-text h2 {
    font-size: 1.4em;
}

.output-text h3 {
    font-size: 1.2em;
}

/* SEO Rating Animation Styles */
.seo-rating-container {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.seo-rating-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.rating-title {
    font-size: 1.5em;
    color: #1e293b;
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.rating-circle {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.rating-svg {
    transform: rotate(-90deg);
}

.rating-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 12;
}

.rating-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 2s ease-out;
}

.rating-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.rating-number {
    display: block;
    font-size: 3em;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

.rating-label {
    display: block;
    font-size: 1em;
    color: #64748b;
    margin-top: 5px;
}

.rating-stars {
    margin-bottom: 20px;
    font-size: 2em;
    position: relative;
    z-index: 1;
}

.star {
    display: inline-block;
    margin: 0 5px;
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.3s ease;
    transform: scale(0.8);
}

.star.active {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
    animation: starPop 0.6s ease-out;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.1); }
}

.rating-message {
    font-size: 1.1em;
    color: #64748b;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.rating-message.success {
    color: #10b981;
    font-weight: 600;
    font-size: 1.2em;
}

/* WordPress Section Styles */
.wordpress-section {
    text-align: center;
    padding: 40px !important;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%) !important;
    color: white;
}

.wp-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: white;
    color: #0073aa;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wp-send-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.wp-send-btn:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 24px;
}

.btn-text {
    font-size: 18px;
}

.wp-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-top: 15px;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .optimize-btn {
        width: 200px;
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .rating-svg {
        width: 150px;
        height: 150px;
    }
    
    .rating-bg,
    .rating-progress {
        r: 67.5;
        cx: 75;
        cy: 75;
    }
    
    .rating-number {
        font-size: 2.2em;
    }
    
    .rating-stars {
        font-size: 1.5em;
    }
    
    .output-item {
        padding: 20px;
    }
    
    .wp-send-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .btn-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.9em;
        margin-bottom: 30px;
    }
    
    textarea {
        padding: 12px;
        font-size: 14px;
    }
    
    .optimize-btn {
        width: 180px;
        padding: 12px 25px;
        font-size: 15px;
    }
}