* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --success: #10b981;
    --danger: #ef4444;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

body { background: var(--bg); color: var(--text); transition: all 0.3s ease; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: var(--card-bg); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; padding: 15px 0; }
.header-content { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.logo i { font-size: 1.8rem; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.search-box input { width: 100%; padding: 12px 15px 12px 45px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 0.95rem; outline: none; transition: all 0.3s; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
.theme-toggle { width: 45px; height: 45px; border-radius: 12px; border: 2px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: 1.1rem; transition: all 0.3s; }
.theme-toggle:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Hero */
.hero { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%); color: white; padding: 60px 0; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 10px; font-weight: 800; }
.hero p { font-size: 1.05rem; opacity: 0.95; margin-bottom: 30px; }
.hero-stats { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); padding: 18px 30px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.2); }
.stat h3 { font-size: 1.8rem; font-weight: 800; }
.stat p { font-size: 0.85rem; opacity: 0.9; }

/* Categories */
.categories { padding: 40px 0 20px; }
.section-title { font-size: 1.5rem; margin-bottom: 20px; color: var(--text); }
.category-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-btn { padding: 10px 18px; border: 2px solid var(--border); background: var(--card-bg); color: var(--text); border-radius: 25px; cursor: pointer; font-size: 0.88rem; font-weight: 600; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
.cat-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

/* Tools Grid */
.tools-section { padding: 20px 0 60px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.tool-card { background: var(--card-bg); border-radius: 16px; padding: 25px 20px; text-align: center; cursor: pointer; transition: all 0.3s; border: 2px solid transparent; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tool-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), #ec4899); transform: scaleX(0); transition: transform 0.3s; }
.tool-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 1.6rem; color: white; }
.tool-card h3 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.tool-card p { font-size: 0.8rem; color: var(--text-light); line-height: 1.4; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; padding: 20px; overflow-y: auto; backdrop-filter: blur(5px); }
.modal.active { display: flex; align-items: center; justify-content: center; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { background: var(--card-bg); border-radius: 20px; width: 100%; max-width: 650px; max-height: 90vh; overflow-y: auto; animation: slideUp 0.3s; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-bg); z-index: 10; }
.modal-header h3 { font-size: 1.2rem; color: var(--text); }
.close-btn { width: 35px; height: 35px; border-radius: 10px; border: none; background: var(--bg); color: var(--text); cursor: pointer; font-size: 1rem; transition: all 0.3s; }
.close-btn:hover { background: var(--danger); color: white; }
.modal-body { padding: 25px; }

/* Form Elements */
.tool-form label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text); margin-top: 12px; }
.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form input[type="date"],
.tool-form input[type="email"],
.tool-form input[type="url"],
.tool-form textarea,
.tool-form select { width: 100%; padding: 12px 15px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 0.95rem; margin-bottom: 8px; outline: none; transition: all 0.3s; font-family: inherit; }
.tool-form input:focus, .tool-form textarea:focus, .tool-form select:focus { border-color: var(--primary); }
.tool-form textarea { min-height: 100px; resize: vertical; }
.tool-form input[type="range"] { width: 100%; margin: 8px 0; }
.tool-form input[type="checkbox"] { width: auto; margin-right: 8px; }

.btn { padding: 12px 22px; border: none; border-radius: 12px; background: var(--primary); color: white; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; margin: 8px 8px 8px 0; text-decoration: none; }
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }
.btn-secondary { background: var(--text-light); }
.btn-secondary:hover { background: #475569; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }

.result-box { background: var(--bg); border: 2px dashed var(--primary); border-radius: 12px; padding: 18px; margin-top: 15px; word-break: break-word; font-size: 0.95rem; color: var(--text); min-height: 60px; white-space: pre-line; }
.result-box.success { border-color: var(--success); background: rgba(16, 185, 129, 0.1); border-style: solid; }
.result-box code { background: rgba(99, 102, 241, 0.15); padding: 3px 8px; border-radius: 6px; font-family: 'Courier New', monospace; font-size: 0.85rem; }

/* Footer */
.footer { background: var(--card-bg); padding: 30px 0; text-align: center; border-top: 1px solid var(--border); color: var(--text-light); font-size: 0.9rem; }
.footer-links { margin-top: 10px; }
.footer-links a { color: var(--primary); text-decoration: none; margin: 0 5px; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 0.95rem; }
    .hero-stats { gap: 10px; }
    .stat { padding: 12px 20px; }
    .stat h3 { font-size: 1.4rem; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .tool-card { padding: 20px 12px; }
    .tool-icon { width: 50px; height: 50px; font-size: 1.3rem; }
    .tool-card h3 { font-size: 0.9rem; }
    .logo span { font-size: 1rem; }
    .header-content { gap: 10px; }
    .search-box { order: 3; flex-basis: 100%; }
    .modal-body { padding: 18px; }
}
/* ===== NEW: Simple Interest Tabs ===== */
.si-tabs { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.si-tab { padding: 8px 16px; border: 2px solid var(--border); background: var(--card-bg); color: var(--text); border-radius: 20px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.3s; }
.si-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.si-tab-content { display: none; }
.si-tab-content.active { display: block; }

/* ===== NEW: Currency & Live Rate ===== */
.rate-info { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1)); border-radius: 12px; padding: 12px; text-align: center; margin-bottom: 15px; font-size: 0.85rem; color: var(--text-light); }
.rate-info b { color: var(--primary); }
.currency-swap { text-align: center; margin: 10px 0; }
.swap-btn { width: 45px; height: 45px; border-radius: 50%; border: none; background: var(--primary); color: white; cursor: pointer; font-size: 1.1rem; transition: all 0.3s; }
.swap-btn:hover { transform: rotate(180deg); }

/* ===== NEW: Passport Photo Grid ===== */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 15px; }
@media (min-width: 480px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-option { background: var(--bg); border: 2px solid var(--border); border-radius: 12px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.3s; }
.photo-option:hover { border-color: var(--primary); transform: translateY(-3px); }
.photo-option.selected { border-color: var(--primary); background: rgba(99,102,241,0.1); }
.photo-option i { font-size: 1.8rem; color: var(--primary); margin-bottom: 8px; display: block; }
.photo-option h4 { font-size: 0.9rem; margin-bottom: 4px; }
.photo-option p { font-size: 0.75rem; color: var(--text-light); }
.photo-preview { text-align: center; margin-top: 15px; }
.photo-preview img { max-width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.photo-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 15px; }