/* ============================================
   PdfMetric - Modern Light Theme
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --text-muted: #6c757d;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
}

/* Base Styles */
body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #0a58ca;
}

/* ============================================
   Header & Navigation
   ============================================ */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: var(--dark-color) !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

.language-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    color: white;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.hero-search {
    max-width: 600px;
    margin: 2rem auto 0;
}

.hero-search .form-control {
    height: 56px;
    font-size: 1.1rem;
    border-radius: var(--border-radius-lg);
    border: none;
    padding-left: 1.5rem;
}

.hero-search .btn {
    height: 56px;
    border-radius: var(--border-radius-lg);
    padding: 0 2rem;
    font-weight: 600;
}

/* ============================================
   Tool Cards
   ============================================ */
.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.tool-card .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.tool-card:hover .icon {
    transform: scale(1.1);
}

.tool-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
    flex-grow: 1;
}

.tool-card .badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* Category Colors */
.tool-card.category-pdf .icon { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.tool-card.category-pdf-convert .icon { background-color: rgba(253, 126, 20, 0.1); color: #fd7e14; }
.tool-card.category-image .icon { background-color: rgba(40, 167, 69, 0.1); color: #28a745; }
.tool-card.category-file .icon { background-color: rgba(0, 123, 255, 0.1); color: #007bff; }
.tool-card.category-ocr .icon { background-color: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.tool-card.category-print .icon { background-color: rgba(23, 162, 184, 0.1); color: #17a2b8; }
.tool-card.category-security .icon { background-color: rgba(52, 58, 64, 0.1); color: #343a40; }
.tool-card.category-advanced .icon { background-color: rgba(108, 117, 125, 0.1); color: #6c757d; }

/* ============================================
   Category Section
   ============================================ */
.category-section {
    padding: 3rem 0;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.category-header .icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}

.category-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* ============================================
   File Upload Zone
   ============================================ */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    background: var(--card-bg);
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.upload-zone .icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-zone h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-zone .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.upload-zone input[type="file"] {
    display: none;
}

/* ============================================
   File List
   ============================================ */
.file-list {
    margin-top: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.file-item .file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
}

.file-item .file-info {
    flex-grow: 1;
}

.file-item .file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-item .file-size {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-item .file-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
    margin-top: 1.5rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--light-color);
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================================
   Result Section
   ============================================ */
.result-section {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(25, 135, 84, 0.1);
    border-radius: var(--border-radius-lg);
    text-align: center;
}

.result-section .icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.result-section h4 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.result-section .btn-download {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

/* ============================================
   Related Tools
   ============================================ */
.related-tools {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-tools h4 {
    margin-bottom: 1.5rem;
}

/* ============================================
   Popular Tools Badge
   ============================================ */
.popular-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

/* ============================================
   Advertisement Placeholders
   ============================================ */
.ad-banner {
    min-height: 90px;
}

.ad-sidebar {
    min-height: 250px;
    background: var(--light-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb-container {
    background: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--dark-color);
    font-weight: 500;
}

/* ============================================
   Tool Page
   ============================================ */
.tool-page {
    padding: 2rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header .icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.tool-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .tool-card .icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-zone .icon {
        font-size: 3rem;
    }
    
    .category-header h2 {
        font-size: 1.25rem;
    }
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] .me-1, [dir="rtl"] .me-2, [dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .ms-1, [dir="rtl"] .ms-2, [dir="rtl"] .ms-3 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
}

/* ============================================
   Utility Classes
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ============================================
   Footer Styles
   ============================================ */

footer {
    background-color: #1a1a2e !important;
}

footer h6 {
    letter-spacing: 0.5px;
}

.footer-link {
    transition: var(--transition);
}

.footer-link:hover {
    color: #ffffff !important;
    text-decoration: none;
}

footer .form-select {
    background-color: #16213e;
    border-color: #0f3460;
}

footer .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
