/* SyncDrive Style Sheet - Premium Dark Mode & Glassmorphism Design System */

:root {
    --bg-app: #080b11;
    --bg-sidebar: #0c101b;
    --bg-card: rgba(17, 24, 39, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(79, 70, 229, 0.4);
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.35);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #4b5563;
    
    --sidebar-width: 260px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* SIDEBAR STYLES */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-area h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a5b4fc 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    color: var(--text-main);
    background: rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.25);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.status-indicator-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.pulse-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.pulse-dot.online::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background-color: var(--success);
    opacity: 0.6;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.shutdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.shutdown-btn:hover {
    background: var(--danger);
    color: white;
}

.shutdown-btn svg {
    width: 14px;
    height: 14px;
}

/* MAIN CONTENT STYLES */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px 40px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.title-section h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.target-drive-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.badge-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* TABS CONFIGURATION */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn var(--transition-fast);
}

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

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

/* HERO SECTION - CIRCLE PROGRESS & ACTIONS */
.dashboard-hero {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px 32px;
    align-items: center;
}

.progress-circle-container {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-circle-bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring-circle-fill {
    fill: transparent;
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.progress-inner-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#progress-percentage {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

#sync-state-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

#sync-state-label.idle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

#sync-state-label.running {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
    animation: textPulse 1.5s infinite alternate;
}

#sync-state-label.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

#sync-state-label.cancelled {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

@keyframes textPulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.current-sync-info {
    margin-bottom: 24px;
}

.info-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    font-size: 18px;
    font-weight: 500;
    margin-top: 6px;
    color: var(--text-main);
    word-break: break-all;
}

.control-buttons {
    display: flex;
    gap: 16px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-glow {
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* STATS ROW */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.stat-icon-wrapper.copied {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon-wrapper.skipped {
    background: rgba(79, 70, 229, 0.1);
    color: #818cf8;
}

.stat-icon-wrapper.errors {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* CONSOLE/LOG PANEL */
.console-section {
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: 300px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.console-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.console-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.console-line {
    word-break: break-all;
    white-space: pre-wrap;
    color: #d1d5db;
}

.console-line.system-msg {
    color: #6b7280;
}

.console-line.copied-file {
    color: #34d399; /* Green for new/modified file */
}

.console-line.skipped-file {
    color: #a5b4fc; /* Purple/Blue for skipped file */
}

.console-line.error-msg {
    color: #f87171; /* Red for errors */
}

.console-line.warning-msg {
    color: #fbbf24; /* Yellow for warnings */
}

/* SETTINGS VIEW & CARDS */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 700;
}

.settings-card .description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.drive-select-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flex-grow {
    flex-grow: 1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control option {
    background-color: var(--bg-sidebar);
    color: white;
}

.m-top {
    margin-top: 24px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* FOLDER LIST TABLE */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.folder-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.folder-table th, .folder-table td {
    padding: 14px 18px;
}

.folder-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.folder-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.folder-table tr:last-child td {
    border-bottom: none;
}

.folder-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.btn-icon-only {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid transparent;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon-only:hover {
    background: var(--danger);
    color: white;
}

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

/* MODAL STYLES */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-fast);
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    background: var(--bg-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: white;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body small {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.badge-mode {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-mode.mode-mirror {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-mode.mode-incremental {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    
    .current-sync-info {
        text-align: center;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
