/* Universal Docs Downloader - Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

header {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Platform Tabs Navigation */
.platform-tabs {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 1rem;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    min-width: 120px;
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tab-btn:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-icon {
    font-size: 1.5rem;
    display: block;
}

.tab-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.tab-btn.active .tab-icon {
    transform: scale(1.1);
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem 0;
}

section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Platform Info Section */
.platform-info {
    margin-bottom: 1.5rem;
}

.selected-platform {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.selected-platform h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-platform p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.platform-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-badge {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.url-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.url-input label {
    font-weight: 500;
    color: var(--text-primary);
}

.url-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.url-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

button:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

.status-card {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.status-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.doc-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 4px;
}

.doc-info-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.download-options h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.format-selection {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.format-selection label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    transition: all 0.2s;
}

.format-selection label:hover {
    border-color: var(--primary-color);
    background: rgb(37 99 235 / 0.05);
}

.format-selection input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background: rgb(37 99 235 / 0.1);
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    background: var(--success-color);
    font-size: 1.1rem;
    padding: 1rem;
}

.download-btn:hover {
    background: #047857;
}

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logs-container {
    max-height: 300px;
    overflow-y: auto;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.log-timestamp {
    color: #64748b;
    font-size: 0.8rem;
}

.log-info { color: #3b82f6; }
.log-success { color: #059669; }
.log-warning { color: #d97706; }
.log-error { color: #dc2626; }

footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.disclaimer {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .tabs-container {
        padding: 0 0.5rem;
        gap: 0;
    }
    
    .tab-btn {
        min-width: 80px;
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .tab-icon {
        font-size: 1.2rem;
    }
    
    .tab-text {
        font-size: 0.75rem;
        display: none;
    }
    
    .tab-btn.active .tab-text {
        display: block;
    }
    
    main {
        padding: 1rem 0.5rem 0;
    }
    
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .selected-platform {
        padding: 1rem;
    }
    
    .selected-platform h3 {
        font-size: 1rem;
    }
    
    .platform-features {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .feature-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .format-selection {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .format-selection label {
        justify-content: center;
    }
    
    .url-input {
        gap: 1rem;
    }
    
    .download-btn {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .platform-links {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .platform-link {
        padding: 1.25rem;
    }
    
    .link-icon {
        font-size: 2rem;
    }
    
    .link-content h3 {
        font-size: 1rem;
    }
    
    .link-content p {
        font-size: 0.85rem;
    }
    
    .link-content code {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .tab-btn {
        min-width: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .tab-text {
        display: none !important;
    }
    
    .selected-platform h3 {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.95rem;
    }
    
    .platform-features {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 1rem 0.25rem 0;
    }
}

/* SEO and Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for accessibility */
.tab-btn:focus,
button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --text-primary: #000000;
        --bg-color: #ffffff;
        --border-color: #000000;
    }
}

/* Platform Links Section */
.platform-links {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.platform-links h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.platform-links p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.platform-link {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.platform-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.platform-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.platform-link:hover::before {
    transform: scaleX(1);
}

.link-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.link-content {
    flex: 1;
}

.link-content h3 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.link-content p {
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.link-content code {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 500;
}

/* Platform-specific colors */
.studocu-link:hover::before {
    background: #1a73e8;
}

.scribd-link:hover::before {
    background: #1e88e5;
}

.slideshare-link:hover::before {
    background: #00a0dc;
}

.academia-link:hover::before {
    background: #2c3e50;
}

.researchgate-link:hover::before {
    background: #00d0ae;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .platform-link:hover {
        transform: none;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}