/* ========================================
   SCRIPT COPIER WEB - CLAUDE LOOPLESS THEME
   Desktop Layout Style
   ======================================== */

:root {
    /* Claude Loopless Colors */
    --bg-primary: #faf9f5;
    --bg-secondary: #ffffff;
    --bg-hover: #f5f4f0;
    --accent-primary: #cb6246;
    --accent-secondary: #a8d5ba;
    --success-green: #d4edda;
    --success-border: #c3e6cb;
    --text-primary: #2d2d2d;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e5e4df;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.logo .version {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #b55538;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--accent-secondary);
    color: white;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: #97c9a9;
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.root-folder-dropdown {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.root-folder-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-hover);
}

/* ========================================
   CONTAINER
   ======================================== */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* ========================================
   PROJECT SELECTOR BAR
   ======================================== */

.project-selector-bar {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.project-selector-bar label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.project-dropdown {
    flex: 1;
    max-width: 400px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.project-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.folder-path {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state-large {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-state-large svg {
    margin-bottom: 1.5rem;
}

.empty-state-large h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state-large p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.folder-structure-hint {
    margin-top: 1rem !important;
    font-size: 0.9rem !important;
    color: var(--text-muted) !important;
}

/* ========================================
   TABS
   ======================================== */

.tabs-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-hover);
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--accent-primary);
    background: var(--bg-secondary);
    border-bottom-color: var(--accent-primary);
}

.tabs-content {
    padding: 1.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   TWO COLUMN LAYOUT (Seções + Preview)
   ======================================== */

.two-column-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 300px);
    align-items: start;
}

.sections-column,
.preview-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.column-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.5px;
}

.sections-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* ========================================
   SECTION CARDS (Green with checkmark)
   ======================================== */

.section-card {
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.section-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.section-card.active {
    border-color: var(--accent-primary);
    background: #fff5f2;
    box-shadow: var(--shadow-md);
}

.section-card.copied {
    background: var(--success-green);
    border-color: var(--success-border);
}

.section-card.copied::before {
    content: '✓';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
}

.section-card.copied .section-title {
    margin-left: 1.5rem;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.word-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-secondary);
}

/* ========================================
   TEXT PREVIEW
   ======================================== */

.text-preview {
    flex: 1;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
}

.preview-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.btn-copy-large {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-copy-large:hover {
    background: #b55538;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-save-text {
    background: var(--accent-secondary);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-save-text:hover {
    background: #97c9a9;
    transform: translateY(-2px);
}

.copy-count-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-message p {
    margin-top: 0.5rem;
}

/* ========================================
   FILES VIEW (2 colunas)
   ======================================== */

.files-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.file-content-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.files-list-sidebar {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.file-item {
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-item:hover {
    border-color: var(--accent-primary);
    background: #fff5f2;
    transform: translateX(4px);
}

.file-item.active {
    border-color: var(--accent-primary);
    background: #fff5f2;
    box-shadow: var(--shadow-sm);
}

.file-item::before {
    content: '📄';
    font-size: 1.2rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-content-preview {
    flex: 1;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    height: 100%;
}

/* ========================================
   YOUTUBE TAB
   ======================================== */

.youtube-container {
    max-width: 900px;
}

.youtube-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.youtube-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-status-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.video-status-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-section {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.titles-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.title-option {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 0.75rem;
}

.title-option label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.title-option input[type="text"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.title-option input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-copy-icon {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-copy-icon:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-hover);
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-save-youtube {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn-save-youtube:hover {
    background: #b55538;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: var(--accent-primary);
}

.toast.info {
    background: #17a2b8;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--accent-primary);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background-color: #ffffff;
}

.modal-body h3 {
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-body ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.about-logo {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
}

/* Icon buttons */
.btn-icon {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn-icon:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-hover);
}

.btn-analyze {
    background: var(--accent-secondary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-analyze:hover {
    background: #97c9a9;
    transform: translateY(-1px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-hover);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.comparison-icon {
    font-size: 1.2rem;
}

.btn-ai-detect {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.btn-ai-detect:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-ai-detect svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ========================================
   SCROLLBAR CUSTOMIZATION
   ======================================== */

.sections-list::-webkit-scrollbar,
.text-preview::-webkit-scrollbar,
.files-list-sidebar::-webkit-scrollbar,
.file-content-preview::-webkit-scrollbar {
    width: 8px;
}

.sections-list::-webkit-scrollbar-track,
.text-preview::-webkit-scrollbar-track,
.files-list-sidebar::-webkit-scrollbar-track,
.file-content-preview::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 4px;
}

.sections-list::-webkit-scrollbar-thumb,
.text-preview::-webkit-scrollbar-thumb,
.files-list-sidebar::-webkit-scrollbar-thumb,
.file-content-preview::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sections-list::-webkit-scrollbar-thumb:hover,
.text-preview::-webkit-scrollbar-thumb:hover,
.files-list-sidebar::-webkit-scrollbar-thumb:hover,
.file-content-preview::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: 400px 1fr;
    }
}

@media (max-width: 968px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .sections-column {
        max-height: 400px;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .project-selector-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .project-dropdown {
        max-width: none;
    }

    .tabs-nav {
        flex-direction: column;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.section-card,
.file-item {
    animation: fadeIn 0.3s ease;
}
