/* ============================================
   SmartTools - Responsive CSS
   Mobile-First Approach
   ============================================ */

/* ============================================
   1. CSS VARIABLES & RESET
   ============================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #a855f7;
    --dark: #131320;
    --dark-2: #1a1a2e;
    --dark-card: #252540;
    --dark-lighter: #32325c;
    --text: #f1f1f5;
    --text-muted: #a0a0b8;
    --success: #10b981;
    --error: #ef4444;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-hover: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ============================================
   2. BASE LAYOUT - MOBILE FIRST
   ============================================ */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

/* ============================================
   3. HEADER & NAVIGATION
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}

/* Navigation Links - Mobile */
.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark-card);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
}

.nav-links.active {
    display: flex;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ============================================
   4. HERO SECTION - MOBILE
   ============================================ */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 1rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    z-index: -1;
}

.hero-content {
    width: 100%;
    max-width: 100%;
}

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

.hero-badge {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.7rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.hero-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.stat-number {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ============================================
   5. BUTTONS - MOBILE
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* Full width buttons on mobile */
.btn.btn-block {
    width: 100%;
}

/* ============================================
   6. TOOLS SECTION - MOBILE
   ============================================ */
.tools-section {
    padding: 2.5rem 0;
    background: rgba(26, 26, 46, 0.3);
}

.section-title {
    font-size: clamp(1.4rem, 5vw, 1.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.tools-grid,
.tools-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
}

/* Tool Cards */
.tool-link-card {
    text-decoration: none;
    display: block;
}

.tool-card-new {
    background: var(--dark-card);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.tool-card-new:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

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

.tool-card-icon {
    width: 2.8rem;
    height: 2.8rem;
    background: var(--gradient);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    margin-bottom: 1rem;
}

.tool-card-new h3 {
    font-size: 1rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tool-card-new p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 0.75rem;
}

.tool-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.tool-use-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.tool-use-btn i {
    transition: transform 0.3s ease;
}

.tool-card-new:hover .tool-use-btn i {
    transform: translateX(4px);
}

/* ============================================
   7. FEATURES SECTION - MOBILE
   ============================================ */
.features-section {
    padding: 2rem 0;
}

.features-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.feature {
    background: var(--dark-card);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.feature:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.feature-icon {
    width: 2.2rem;
    height: 2.2rem;
    background: var(--gradient);
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
    font-size: 1rem;
    color: white;
}

.feature h3 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: white;
}

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

/* ============================================
   8. CTA SECTION - MOBILE
   ============================================ */
.cta-section {
    padding: 2rem 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
}

.cta-section h2 {
    font-size: clamp(1.3rem, 5vw, 1.75rem);
    margin-bottom: 0.6rem;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

/* ============================================
   9. FOOTER - MOBILE
   ============================================ */
.footer {
    background: var(--dark-2);
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-brand {
    grid-column: span 2;
    text-align: center;
}

.footer-brand .logo {
    font-size: 1.2rem;
    justify-content: center;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.footer-links h4,
.footer-legal h4 {
    color: white;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.footer-links,
.footer-legal {
    text-align: center;
}

.footer-links ul,
.footer-legal ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.footer-links a,
.footer-legal a {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.3s;
}

.footer-links a:hover,
.footer-legal a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0.3rem 0;
}

/* ============================================
   10. FORMS & INPUTS - MOBILE
   ============================================ */
.input-row,
.converter-row,
.tz-row,
.timezone-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input,
.input-group select,
.converter-select select,
.converter-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    background: var(--dark);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus,
.converter-select select:focus,
.converter-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.swap-btn,
.swap-button,
.timezone-swap-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-btn:hover,
.swap-button:hover {
    transform: rotate(180deg) scale(1.1);
}

/* Hide swap buttons on small mobile */
@media (max-width: 380px) {
    .swap-btn.small,
    .swap-button,
    .timezone-swap-btn {
        display: none;
    }
}

.result-box {
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* ============================================
   11. TOOL PAGES - MOBILE
   ============================================ */
.tool-page {
    min-height: 100vh;
    padding: 5rem 1rem 2rem;
}

.tool-page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-page-header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-page-content {
    width: 100%;
    max-width: 100%;
}

.currency-tool-container,
.calculator-tool-container,
.timezone-tool-container {
    background: var(--dark-card);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    width: 100%;
}

.calculator-tool-container {
    max-width: 100%;
}

/* Calculator */
.calc-display-tool input {
    width: 100%;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--dark);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    text-align: right;
    font-weight: 600;
}

.calc-buttons-tool {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.calc-btn-tool {
    padding: 1rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--dark);
    color: white;
    min-height: 50px;
}

.calc-btn-tool:hover {
    background: var(--dark-lighter);
    transform: scale(1.02);
}

.calc-btn-tool.clear-tool {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.calc-btn-tool.operator-tool {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.calc-btn-tool.equals-tool {
    background: var(--gradient);
}

.calc-btn-tool.zero-tool {
    grid-column: span 2;
}

/* Time Zone */
.timezone-main-display {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.timezone-clocks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.timezone-clock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timezone-clock-item .city {
    font-size: 1rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timezone-clock-item .time {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
}

.timezone-clock-item .zone {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--dark);
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    margin-top: 0.5rem;
}

/* ============================================
   12. SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* ============================================
   MEDIA QUERIES - TABLET (768px)
   ============================================ */
@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .nav {
        padding: 0.75rem 1.5rem;
    }

    .hero {
        min-height: 90vh;
        padding: 7rem 2rem 3rem;
    }

    .hero-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.25rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .btn.btn-block {
        width: auto;
    }

    .tools-section {
        padding: 3.5rem 0;
    }

    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
    }

    .tools-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .tool-card-new {
        padding: 1.5rem 1.25rem;
    }

    .tool-card-icon {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.5rem;
    }

    .tool-card-new h3 {
        font-size: 1.1rem;
    }

    .tool-card-new p {
        font-size: 0.85rem;
    }

    .features-grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .feature {
        flex: 1 1 200px;
        max-width: 220px;
        padding: 1rem 1.25rem;
    }

    .cta-section {
        padding: 3rem 0;
    }

    .cta-section h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .footer {
        padding: 2.5rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-links,
    .footer-legal {
        text-align: left;
    }

    .footer-links ul,
    .footer-legal ul {
        display: block;
    }

    .footer-links a,
    .footer-legal a {
        display: block;
        margin-bottom: 0.5rem;
    }

    .input-row,
    .converter-row,
    .tz-row,
    .timezone-row {
        flex-direction: row;
    }

    .swap-btn.small,
    .swap-button,
    .timezone-swap-btn {
        display: flex;
    }

    .tool-page {
        padding: 6rem 2rem 3rem;
    }

    .tool-page-header {
        margin-bottom: 2.5rem;
    }

    .tool-page-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .currency-tool-container,
    .calculator-tool-container,
    .timezone-tool-container {
        padding: 2rem;
    }

    .calculator-tool-container {
        max-width: 350px;
        margin: 0 auto;
    }

    .timezone-clocks {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============================================
   MEDIA QUERIES - DESKTOP (1024px)
   ============================================ */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
        max-width: 1100px;
    }

    .nav {
        padding: 0.75rem 2rem;
        max-width: 1100px;
    }

    .nav-links {
        display: flex;
        position: static;
        background: none;
        flex-direction: row;
        padding: 0;
        gap: 1.5rem;
    }

    .mobile-menu-btn {
        display: none;
    }

    .hero {
        min-height: 100vh;
        padding: 8rem 3rem 4rem;
    }

    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .hero-subtitle {
        font-size: 1.15rem;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-stats {
        gap: 2.5rem;
        margin-top: 3rem;
    }

    .stat {
        flex-direction: column;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .tools-section {
        padding: 5rem 0;
    }

    .section-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .tools-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .tool-card-new {
        padding: 2rem 1.5rem;
    }

    .tool-card-icon {
        width: 4rem;
        height: 4rem;
        font-size: 1.75rem;
    }

    .tool-card-new h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .tool-card-new p {
        font-size: 0.9rem;
    }

    .features-section {
        padding: 3rem 0;
    }

    .features-grid {
        flex-wrap: nowrap;
        gap: 1.25rem;
    }

    .feature {
        flex: none;
        max-width: none;
    }

    .cta-section {
        padding: 4rem 0;
    }

    .cta-section h2 {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
    }

    .footer {
        padding: 3.5rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .tool-page {
        padding: 7rem 3rem 4rem;
    }

    .tool-page-content {
        max-width: 600px;
    }

    .currency-tool-container,
    .timezone-tool-container {
        padding: 2.5rem;
    }
}

/* ============================================
   MEDIA QUERIES - LARGE SCREEN (1280px)
   ============================================ */
@media (min-width: 1280px) {
    .container {
        padding: 0 3rem;
        max-width: 1200px;
    }

    .nav {
        padding: 1rem 3rem;
        max-width: 1200px;
    }

    .hero {
        padding: 10rem 4rem 5rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .hero-subtitle {
        font-size: 1.25rem;
        max-width: 600px;
    }

    .hero-stats {
        gap: 3rem;
        margin-top: 3.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .tools-section {
        padding: 6rem 0;
    }

    .tools-cards-grid {
        gap: 2rem;
    }

    .tool-card-new {
        padding: 2.5rem 2rem;
    }

    .tool-card-icon {
        width: 5rem;
        height: 5rem;
        font-size: 2rem;
        border-radius: 1.25rem;
    }

    .tool-card-new h3 {
        font-size: 1.5rem;
    }

    .tool-card-new p {
        font-size: 1rem;
    }
}