/**
 * Frontend Styles for YouTube SEO Assistant
 * 
 * @package YouTube_SEO_Assistant
 */

/* Reset and Base Styles */
.yseoa-frontend-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
}

.yseoa-theme-dark {
    background: #1a1a1a;
    color: #fff;
}

.yseoa-theme-dark .yseoa-form-group input,
.yseoa-theme-dark .yseoa-form-group select,
.yseoa-theme-dark .yseoa-form-group textarea {
    background: #2a2a2a;
    color: #fff;
    border-color: #444;
}

/* Header Section */
.yseoa-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.yseoa-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.yseoa-header-content {
    position: relative;
    z-index: 1;
}

.yseoa-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.yseoa-icon {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.yseoa-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

/* Ad Banner */
.yseoa-ad-banner {
    margin-top: 20px;
}

.yseoa-ad-placeholder {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.yseoa-ad-label {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.yseoa-ad-content {
    margin-top: 10px;
}

.yseoa-ad-cta {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.yseoa-ad-cta:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Main Content Layout */
.yseoa-main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .yseoa-main-content {
        grid-template-columns: 1fr;
    }
}

/* Stats Section */
.yseoa-stats-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.yseoa-theme-dark .yseoa-stats-section {
    background: #2a2a2a;
}

.yseoa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.yseoa-stat-card {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.yseoa-theme-dark .yseoa-stat-card {
    background: #333;
}

.yseoa-stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.yseoa-stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yseoa-theme-dark .yseoa-stat-label {
    color: #aaa;
}

.yseoa-upgrade-notice {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 8px;
    text-align: center;
}

.yseoa-upgrade-btn {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.yseoa-upgrade-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Form Section */
.yseoa-form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.yseoa-theme-dark .yseoa-form-section {
    background: #2a2a2a;
}

.yseoa-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.yseoa-full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .yseoa-form-grid {
        grid-template-columns: 1fr;
    }
}

.yseoa-form-group {
    margin-bottom: 20px;
}

.yseoa-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.yseoa-theme-dark .yseoa-form-group label {
    color: #fff;
}

.yseoa-form-group input,
.yseoa-form-group select,
.yseoa-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

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

.yseoa-form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

.yseoa-theme-dark .yseoa-form-group small {
    color: #aaa;
}

/* Buttons */
.yseoa-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.yseoa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.yseoa-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.yseoa-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.yseoa-btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.yseoa-theme-dark .yseoa-btn-secondary {
    background: #333;
    color: #fff;
    border-color: #555;
}

.yseoa-btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.yseoa-theme-dark .yseoa-btn-secondary:hover {
    background: #444;
}

.yseoa-btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.yseoa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

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

.yseoa-theme-dark .yseoa-results-section {
    background: #2a2a2a;
}

.yseoa-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.yseoa-theme-dark .yseoa-results-header {
    border-bottom-color: #444;
}

.yseoa-results-header h2 {
    margin: 0;
    color: #333;
}

.yseoa-theme-dark .yseoa-results-header h2 {
    color: #fff;
}

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

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

.yseoa-result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.yseoa-theme-dark .yseoa-result-card {
    background: #333;
}

.yseoa-result-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #333;
}

.yseoa-theme-dark .yseoa-result-card h3 {
    color: #fff;
}

.yseoa-result-content {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 80px;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.5;
}

.yseoa-theme-dark .yseoa-result-content {
    background: #2a2a2a;
    border-color: #555;
    color: #fff;
}

.yseoa-copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yseoa-copy-btn:hover {
    background: #5a6fd8;
}

/* Loading Section */
.yseoa-loading-section {
    text-align: center;
    padding: 60px 20px;
}

.yseoa-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error Section */
.yseoa-error-section {
    text-align: center;
    padding: 60px 20px;
}

.yseoa-error-content {
    max-width: 400px;
    margin: 0 auto;
}

.yseoa-error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.yseoa-error-content h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
}

.yseoa-theme-dark .yseoa-error-content h3 {
    color: #ff6b6b;
}

/* Sidebar */
.yseoa-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.yseoa-sidebar-ad {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.yseoa-theme-dark .yseoa-sidebar-ad {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
}

.yseoa-sidebar-ad h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.yseoa-theme-dark .yseoa-sidebar-ad h3 {
    color: #fff;
}

.yseoa-sidebar-ad ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.yseoa-sidebar-ad li {
    padding: 5px 0;
    color: #555;
}

.yseoa-theme-dark .yseoa-sidebar-ad li {
    color: #ccc;
}

.yseoa-sidebar-cta {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.yseoa-sidebar-cta:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.yseoa-tip {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 6px;
}

.yseoa-theme-dark .yseoa-tip {
    background: rgba(255,255,255,0.1);
}

.yseoa-tip strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.yseoa-theme-dark .yseoa-tip strong {
    color: #fff;
}

.yseoa-tip p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.yseoa-theme-dark .yseoa-tip p {
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .yseoa-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .yseoa-form-actions {
        flex-direction: column;
    }
    
    .yseoa-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .yseoa-results-actions {
        justify-content: center;
    }
}

/* Character Counters */
.yseoa-char-counter {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.yseoa-theme-dark .yseoa-char-counter {
    color: #aaa;
}

.yseoa-char-counter-over {
    color: #dc3545 !important;
}

.yseoa-theme-dark .yseoa-char-counter-over {
    color: #ff6b6b !important;
}

/* Field Errors */
.yseoa-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.yseoa-field-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.yseoa-theme-dark .yseoa-field-error-message {
    color: #ff6b6b;
}

/* Print Styles */
@media print {
    .yseoa-sidebar,
    .yseoa-ad-banner,
    .yseoa-form-actions,
    .yseoa-copy-btn {
        display: none !important;
    }
    
    .yseoa-frontend-container {
        max-width: none;
        padding: 0;
    }
}