/* ============================================
   MEGA UTILITY TOOLS HUB - Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-50: #EFF6FF;
    --accent: #F59E0B;
    --accent-dark: #D97706;
    
    --bg: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;
    
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    --success: #10B981;
    --success-bg: #D1FAE5;
    --error: #EF4444;
    --error-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1200px;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Category Colors */
    --cat-calculator: #2563EB;
    --cat-text: #7C3AED;
    --cat-utility: #059669;
    --cat-image: #DC2626;
    --cat-pdf: #EA580C;
}

/* --- Reset / Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition-slow);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.logo, .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.4rem;
}

.logo-icon {
    font-size: 1.6rem;
}

.logo-accent {
    color: var(--primary);
}

/* Navigation */
.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-50);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary);
}

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

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.toggle-bar {
    width: 24px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-toggle.active .toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.active .toggle-bar:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active .toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-white);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero h1 span {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* Search Bar */
.search-container {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    outline: none;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-input:focus {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* ============================================
   TOOL CATEGORY SECTIONS
   ============================================ */
.section {
    padding: 60px 0;
}

.section:nth-child(even) {
    background: var(--bg-secondary);
}

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

.section-icon {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--primary-50);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Tool Cards Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: var(--radius);
    transition: var(--transition);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.1);
}

.tool-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex:1;
}

.tool-card-arrow {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.tool-card:hover .tool-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Category-specific card colors */
.tool-card[data-category="calculator"] .tool-card-icon { background: #EFF6FF; }
.tool-card[data-category="calculator"]::before { background: var(--cat-calculator); }

.tool-card[data-category="text"] .tool-card-icon { background: #F5F3FF; }
.tool-card[data-category="text"]::before { background: var(--cat-text); }

.tool-card[data-category="utility"] .tool-card-icon { background: #ECFDF5; }
.tool-card[data-category="utility"]::before { background: var(--cat-utility); }

.tool-card[data-category="image"] .tool-card-icon { background: #FEF2F2; }
.tool-card[data-category="image"]::before { background: var(--cat-image); }

.tool-card[data-category="pdf"] .tool-card-icon { background: #FFF7ED; }
.tool-card[data-category="pdf"]::before { background: var(--cat-pdf); }

/* ============================================
   TOOL PAGE
   ============================================ */
.tool-page {
    padding: 30px 0 60px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 24px;
}

.breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    margin-right: 8px;
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tool Header */
.tool-header {
    margin-bottom: 32px;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.tool-header p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Tool Body */
.tool-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.tool-body.full-width {
    grid-template-columns: 1fr;
}

.tool-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg);
    transition: var(--transition);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-textarea {
    min-height: 180px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

/* Result Area */
.result-area {
    background: var(--bg-secondary);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 180px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    position: relative;
}

.result-area.has-result {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}

.result-area:empty::before {
    content: 'Result will appear here...';
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font);
}

/* Result Stats */
.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Checkbox & Radio */
.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover, .radio-label:hover {
    border-color: var(--primary-light);
    background: var(--primary-50);
}

.checkbox-label input:checked + span,
.radio-label input:checked + span {
    color: var(--primary);
    font-weight: 600;
}

/* Range Slider */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.range-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ============================================
   RELATED TOOLS
   ============================================ */
.related-tools {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.related-tools h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.notification.success { border-color: var(--success); }
.notification.error { border-color: var(--error); }
.notification.warning { border-color: var(--warning); }

.notification-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   AD BLOCKS
   ============================================ */
.ad-block {
    text-align: center;
    padding: 10px 0;
    margin: 10px 0;
}

.ad-placeholder {
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ============================================
   ABOUT / CONTACT PAGES
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    padding: 50px 0;
    text-align: center;
    color: white;
}

.page-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-hero p {
    color: rgba(255,255,255,0.8);
    font-size: 1.05rem;
}

.page-content {
    padding: 50px 0;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 24px;
}

.content-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.feature-item {
    text-align: center;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: var(--error-bg);
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #0F172A;
    color: rgba(255,255,255,0.7);
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-title {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================
   CALCULATOR SPECIFIC
   ============================================ */
.calc-display {
    background: #0F172A;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 16px;
    text-align: right;
}

.calc-expression {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    min-height: 22px;
}

.calc-result {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    word-break: break-all;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.calc-btn:hover {
    background: var(--primary-50);
}

.calc-btn:active {
    transform: scale(0.95);
}

.calc-btn.operator {
    background: var(--primary-50);
    color: var(--primary);
}

.calc-btn.operator:hover {
    background: var(--primary-light);
}

.calc-btn.equals {
    background: var(--primary);
    color: white;
    grid-column: span 2;
}

.calc-btn.equals:hover {
    background: var(--primary-dark);
}

.calc-btn.clear {
    background: var(--error-bg);
    color: var(--error);
}

.calc-btn.clear:hover {
    background: var(--error);
    color: white;
}

/* ============================================
   COLOR PICKER
   ============================================ */
.color-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.color-input-native {
    width: 100%;
    height: 50px;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    padding: 0;
}

.color-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ============================================
   PASSWORD GENERATOR
   ============================================ */
.password-display {
    background: #0F172A;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.password-text {
    color: #22D3EE;
    font-family: 'Consolas', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    word-break: break-all;
    flex: 1;
}

.password-copy {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.password-copy:hover {
    background: rgba(255,255,255,0.2);
}

.strength-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    margin-top: 12px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-weak { width: 25%; background: var(--error); }
.strength-fair { width: 50%; background: var(--warning); }
.strength-good { width: 75%; background: var(--info); }
.strength-strong { width: 100%; background: var(--success); }

/* ============================================
   IMAGE TOOL
   ============================================ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 16px auto;
    display: block;
}

.image-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.image-info span {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

/* ============================================
   PDF TOOL
   ============================================ */
.pdf-file-list {
    margin-top: 16px;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.pdf-file-icon {
    font-size: 1.5rem;
}

.pdf-file-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

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

.pdf-file-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ============================================
   BMI Result
   ============================================ */
.bmi-gauge {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin: 16px 0;
}

.bmi-segment {
    flex: 1;
}

.bmi-underweight { background: #3B82F6; }
.bmi-normal { background: #10B981; }
.bmi-overweight { background: #F59E0B; }
.bmi-obese { background: #EF4444; }

.bmi-marker {
    width: 4px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 2px;
    margin-top: -4px;
    position: relative;
    transition: margin-left 0.5s ease;
}

.bmi-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.bmi-result-card {
    text-align: center;
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.bmi-value {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
}

.bmi-category {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 6px;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    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;
    border-radius: var(--radius-md);
    z-index: 10;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        height: 60px;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-slow);
        z-index: 999;
    }
    
    .nav.open {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 12px 24px;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        display: none;
    }
    
    .has-dropdown.open .dropdown-menu {
        display: block;
    }
    
    .hero {
        padding: 50px 0 40px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .stats-bar {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tool-card {
        padding: 16px;
    }
    
    .tool-body {
        grid-template-columns: 1fr;
    }
    
    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .tool-header h1 {
        font-size: 1.5rem;
    }
    
    .calc-grid {
        gap: 8px;
    }
    
    .calc-btn {
        padding: 14px;
        font-size: 1rem;
    }
    
    .color-values {
        grid-template-columns: 1fr;
    }
    
    .page-hero h1 {
        font-size: 1.8rem;
    }
    
    .notification {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.7rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
