/* ============================================
   LinkedIn Video Downloader
   Dark Mode Support with Light Mode Default
   Blue Theme for Social Media Tools
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors - Blue Theme */
    --primary: #3399cc;
    --primary-light: #e0f2fe;
    --primary-dark: #2980b9;
    --accent: #60a5fa;
    
    /* Status Colors */
    --success: #339966;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #e64e4e;
    --danger-light: #fee2e2;
    
    /* Background Colors */
    --bg: #f0f9ff;
    --bg-elevated: #ffffff;
    --bg-secondary: #e0f2fe;
    --bg-tertiary: #bae6fd;
    
    /* Text Colors */
    --text: #0c4a6e;
    --text-secondary: #075985;
    --text-muted: #6b7280;
    
    /* Border Colors */
    --border: #bae6fd;
    --border-light: #e0f2fe;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(51, 153, 204, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 204, 0.35);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Input */
    --input-bg: #ffffff;
    --input-border: #bae6fd;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    --accent: #93c5fd;
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    --bg: #0c1929;
    --bg-elevated: #152238;
    --bg-secondary: #1e3a5f;
    --bg-tertiary: #264a6e;
    
    --text: #e0f2fe;
    --text-secondary: #bae6fd;
    --text-muted: #a8a8b3;
    
    --border: #264a6e;
    --border-light: #1e3a5f;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-primary: 0 4px 14px rgba(96, 165, 250, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(96, 165, 250, 0.3);
    
    --input-bg: #1e3a5f;
    --input-border: #264a6e;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Container */
.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.tool-title i {
    color: var(--primary);
}

.tool-description {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* Input Section */
.input-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.input-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
}

.input-header i {
    color: var(--primary);
}

.url-input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.url-input {
    flex: 1 1 0%;
    width: 0;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 153, 204, 0.15);
}

.url-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.paste-btn {
    flex: 0 0 auto;
    width: 46px;
    height: auto;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-md);
    transition: color var(--transition-speed), background var(--transition-speed), border-color var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.paste-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
}

.paste-btn i {
    width: 18px;
    height: 18px;
}

.input-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.hint-item i {
    opacity: 0.6;
}

/* Supported Formats */
.supported-formats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.formats-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.format-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-primary);
    width: 100%;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-download {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(51, 153, 102, 0.25);
    width: 100%;
}

.btn-download:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-download:disabled,
.btn-download.downloading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Download Options */
.download-options {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.download-options .btn {
    flex: 1;
    min-width: 140px;
}

/* Loading Section */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.loading-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background: var(--danger-light);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.error-message i {
    flex-shrink: 0;
}

.error-message span {
    flex: 1;
}

.error-close {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    flex-shrink: 0;
    display: flex;
}

.error-close:hover {
    opacity: 1;
}

/* Results Section */
.results-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

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

.results-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--success);
}

.btn-new-url {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-new-url:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Video Preview */
.video-preview {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
}

.video-preview video {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

/* Video Info */
.video-info {
    margin-bottom: 0.5rem;
}

.single-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text);
}

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

/* Quality Options */
.quality-options {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.quality-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.quality-label i {
    color: var(--primary);
}

.quality-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.625rem 1.25rem;
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed);
    min-width: 100px;
}

.quality-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.quality-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.quality-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.quality-btn.active .quality-name {
    color: var(--primary);
}

.quality-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Manual Section */
.manual-section {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.manual-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.manual-header i {
    color: var(--primary);
}

.manual-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

.manual-steps {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.manual-steps li {
    margin-bottom: 0.5rem;
}

.manual-steps strong {
    color: var(--text);
}

/* Related Tools */
.lvd-related-tools {
    max-width: 1000px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
}

.lvd-related-tools-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.lvd-related-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.lvd-related-label i {
    color: var(--primary);
}

.lvd-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lvd-related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
}

.lvd-related-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.lvd-related-link i {
    width: 16px;
    height: 16px;
}

/* Info Sections */
.lvd-info-sections {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.lvd-info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.lvd-info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1.25rem;
}

.lvd-info-card h2 i {
    color: var(--primary);
}

.lvd-info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.5rem 0 0.75rem;
}

.lvd-info-card h3:first-of-type {
    margin-top: 0;
}

.lvd-info-card p,
.lvd-info-card li {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.lvd-info-card a {
    color: var(--primary);
    text-decoration: none;
}

.lvd-info-card a:hover {
    text-decoration: underline;
}

/* Steps List */
.lvd-steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.lvd-steps-list li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.lvd-steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.lvd-steps-list li strong {
    color: var(--text);
}

.lvd-steps-list a {
    color: var(--primary);
    text-decoration: none;
}

.lvd-steps-list a:hover {
    text-decoration: underline;
}

/* Features Grid */
.lvd-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.lvd-feature-item {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.lvd-feature-item i {
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: block;
}

.lvd-feature-item h4 {
    margin: 0 0 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.lvd-feature-item p {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* FAQ Section */
.lvd-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lvd-faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lvd-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: background-color var(--transition-speed);
}

.lvd-faq-question:hover {
    background: var(--bg-tertiary);
}

.lvd-faq-question i {
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.lvd-faq-item.active .lvd-faq-question i {
    transform: rotate(180deg);
}

.lvd-faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
}

.lvd-faq-item.active .lvd-faq-answer {
    display: block;
}

.lvd-faq-answer p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.lvd-faq-answer a {
    color: var(--primary);
    text-decoration: none;
}

.lvd-faq-answer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .tool-title {
        font-size: 1.35rem;
    }
    
    .input-section {
        padding: 1.25rem;
    }
    
    .download-options {
        flex-direction: column;
    }
    
    .download-options .btn {
        width: 100%;
    }
    
    .lvd-features-grid {
        grid-template-columns: 1fr;
    }
    
    .lvd-related-tools {
        padding: 0 1rem;
    }
    
    .lvd-info-sections {
        padding: 0 1rem 1rem;
    }
    
    .lvd-info-card {
        padding: 1.25rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .single-info {
        gap: 0.5rem;
    }
    
    .video-preview video {
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    .tool-title {
        font-size: 1.2rem;
    }
    
    .single-info {
        flex-direction: column;
        gap: 0.375rem;
    }
}
