/* 🎨 SEO Platform - Main Styles */

/* =================================
   RESET & BASE STYLES
   ================================= */
   
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    overflow-x: hidden;
}

/* =================================
   TYPOGRAPHY
   ================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: #6b7280;
}

a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2563eb;
}

/* =================================
   UTILITY CLASSES
   ================================= */

.hidden { display: none !important; }
.visible { display: block !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }

/* =================================
   BREADCRUMB & NAVIGATION (SIMPLIFIÉ)
   ================================= */

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-top: 0;
    margin-left: 0;
    padding-top: 0.25rem;
    padding-left: 0.25rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.back-button:hover {
    background: #e5e7eb;
    color: #1f2937;
    border-color: #9ca3af;
}

.back-button svg {
    width: 12px;
    height: 12px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.breadcrumb-item {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.75rem;
}

.breadcrumb-item:hover {
    color: #3b82f6;
}

.breadcrumb-item.current {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #d1d5db;
    margin: 0 0.125rem;
    font-size: 0.75rem;
}

/* =================================
   PAGE HEADERS (IMPROVED)
   ================================= */

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

/* =================================
   ROUND ACTION BUTTONS
   ================================= */

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: white;
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-btn.edit {
    background: #3b82f6;
}

.action-btn.edit:hover {
    background: #2563eb;
}

.action-btn.delete {
    background: #ef4444;
}

.action-btn.delete:hover {
    background: #dc2626;
}

.action-btn.view {
    background: #10b981;
}

.action-btn.view:hover {
    background: #059669;
}

.action-btn.sync {
    background: #8b5cf6;
}

.action-btn.sync:hover {
    background: #7c3aed;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* =================================
   PRODUCT SHEETS TOOL STYLES
   ================================= */

.product-sheets-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.input-section, .preview-section {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.sheet-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 300px;
}

.empty-preview {
    color: #9ca3af;
    text-align: center;
    font-style: italic;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.product-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.product-brand {
    color: #6b7280;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.product-category {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #059669;
    margin: 1rem 0;
}

.product-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.preview-note {
    background: #fef3c7;
    color: #92400e;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    margin-top: 1rem;
}

.generated-product-sheet {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.generated-product-sheet .product-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.generated-product-sheet .brand {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.generated-product-sheet .category {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.generated-product-sheet .price {
    font-size: 2rem;
    font-weight: 700;
    color: #059669;
    margin: 1.5rem 0;
}

.generated-product-sheet .description h2,
.generated-product-sheet .features h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.generated-product-sheet .features ul {
    list-style: none;
    padding: 0;
}

.generated-product-sheet .features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    padding-left: 1.5rem;
}

.generated-product-sheet .features li:before {
    content: "✓";
    color: #059669;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.generated-product-sheet .meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #9ca3af;
    text-align: center;
}

.export-options {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.export-buttons .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .product-sheets-interface {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
}

/* =================================
   LOADING SCREEN
   ================================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* =================================
   BUTTONS
   ================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
    border-color: #4b5563;
    color: white;
}

.btn-outline {
    background-color: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-success {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    border-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
    border-color: #d97706;
}

/* =================================
   FORMS
   ================================= */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Language Selection */
.language-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.language-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.language-checkbox:hover {
    background-color: #f9fafb;
    border-color: #3b82f6;
}

.language-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.language-checkbox span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.language-checkbox input[type="checkbox"]:checked + span {
    color: #1f2937;
}

/* Responsive adjustments for language checkboxes */
@media (max-width: 768px) {
    .language-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .language-checkboxes {
        grid-template-columns: 1fr;
    }
}

/* =================================
   MAIN APPLICATION LAYOUT
   ================================= */

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.project-selector {
    position: relative;
}

.project-select {
    min-width: 200px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s ease;
}

.user-button:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1001;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background-color: #f9fafb;
    color: #374151;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-nav {
    padding: 0 1rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section h3 {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

.nav-section-desc {
    font-size: 0.7rem;
    color: #9ca3af;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.85rem;
}

.nav-item:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.nav-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.nav-item .badge {
    background-color: #f59e0b;
    color: white;
    font-size: 0.625rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: 0.75rem;
    margin-left: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    min-height: calc(100vh - 64px - 60px); /* Header height - Footer height */
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #6b7280;
    margin: 0;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* =================================
   FOOTER
   ================================= */

.app-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    margin-left: 280px; /* Account for sidebar */
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.footer-left {
    color: #6b7280;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-right a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: #374151;
}

.footer-right a.active {
    color: #3b82f6;
    font-weight: 500;
}

/* =================================
   CARDS & CONTENT
   ================================= */

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

.card-header h3 {
    margin: 0;
    color: #1f2937;
}

.card-content {
    color: #6b7280;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

.status-badge.success {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.error {
    background-color: #fef2f2;
    color: #991b1b;
}

.status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* =================================
   MODALS
   ================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .app-footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .header-left {
        gap: 1rem;
    }
    
    .project-select {
        min-width: 150px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-left .project-selector {
        display: none;
    }
    
    .footer-right {
        gap: 1rem;
    }
    
    .modal {
        width: 95vw;
        margin: 1rem;
    }
}

/* =================================
   DYNAMIC MENU FEATURES
   ================================= */

.nav-section[data-feature] {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.nav-section.menu-item-hidden {
    opacity: 0.3;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.nav-item.menu-item-hidden {
    opacity: 0.3;
    pointer-events: none;
}
