/**
 * SEO Audit Tool - Main Stylesheet
 * Modern, clean, and responsive design
 */

/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #4fd1c5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1a202c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===================================
   LAYOUT - INDEX PAGE
   =================================== */
.index-body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.index-container {
    max-width: 800px;
}

/* ===================================
   HEADER
   =================================== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.index-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.index-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    color: white;
}

.index-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
}

.btn-back:hover {
    background: rgba(255,255,255,0.3);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 18px 32px;
    font-size: 1.2rem;
}

/* ===================================
   CARDS
   =================================== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 50px;
    margin-bottom: 30px;
}

.card-header {
    padding: 20px 25px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body {
    padding: 25px;
}

/* ===================================
   FEATURES GRID
   =================================== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    text-align: center;
    padding: 20px;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.feature p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

/* ===================================
   FORM ELEMENTS
   =================================== */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.form-input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===================================
   ALERTS & MESSAGES
   =================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-error {
    background: #fee;
    color: #c33;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--secondary-color);
}

/* ===================================
   MODULES LIST
   =================================== */
.modules-list {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 30px;
}

.modules-list h3 {
    color: var(--gray-800);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.module-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

.module-item:last-child {
    border-bottom: none;
}

.module-item:hover {
    padding-left: 10px;
}

.module-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.module-info h4 {
    color: var(--gray-800);
    font-size: 1rem;
    margin-bottom: 3px;
}

.module-info p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

/* ===================================
   LOADING STATE
   =================================== */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: var(--gray-800);
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-status {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ===================================
   PROGRESS BAR
   =================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* ===================================
   RESULTS PAGE
   =================================== */
.url-info {
    background: white;
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.url-info h2 {
    font-size: 1.2rem;
    color: var(--gray-700);
    margin-bottom: 10px;
}

.url-info .url {
    color: var(--primary-color);
    font-size: 1.1rem;
    word-break: break-all;
    font-weight: 500;
}

/* ===================================
   SUMMARY CARDS
   =================================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.summary-card h3 {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.summary-card .label {
    font-size: 0.95rem;
    color: var(--gray-600);
}

/* ===================================
   MODULE SECTIONS
   =================================== */
.module-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.module-section.module-error {
    border-left: 4px solid var(--danger-color);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.module-header {
    padding: 20px 25px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.module-header:hover {
    background: var(--gray-100);
}

.module-header h3 {
    font-size: 1.2rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    margin: 0;
}

.module-toggle {
    font-size: 1.2rem;
    color: var(--gray-600);
    transition: transform 0.3s ease;
}

.module-section.expanded .module-toggle {
    transform: rotate(180deg);
}

.module-content {
    padding: 25px;
    display: none;
    animation: slideDown 0.3s ease;
}

.module-section.expanded .module-content {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   SCORE BADGES
   =================================== */
.score-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.score-excellent {
    background: #d4edda;
    color: #155724;
}

.score-good {
    background: #d1ecf1;
    color: #0c5460;
}

.score-fair {
    background: #fff3cd;
    color: #856404;
}

.score-poor {
    background: #f8d7da;
    color: #721c24;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    text-align: center;
    color: white;
    font-size: 0.875rem;
    opacity: 0.9;
    padding: 20px;
}

.results-footer {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    padding: 30px 20px;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .index-header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 30px 20px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .module-header h3 {
        font-size: 1rem;
    }
    
    .summary-card .score {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .index-header h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 1.1rem;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .page-header,
    .btn-back,
    .footer {
        display: none;
    }
    
    .module-content {
        display: block !important;
    }
    
    .module-section {
        page-break-inside: avoid;
    }
}