/* styles.css - RapidTools Calculators (Based on Main Site) */
:root {
    --primary: #2563eb; /* Professional Tech Blue */
    --dark: #1e293b;
    --light: #f8fafc;
    --text: #334155;
    --white: #ffffff;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--light);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

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

/* === NAVIGATION (FROM MAIN SITE) === */

.hamburger {
    display: none !important;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--dark);
    text-decoration: none;
}

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

.container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    text-decoration: none;
    color: var(--text);
    border: 1px solid #e2e8f0;
    display: block;
}

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

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark);
}

.tool-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* === CALCULATOR-SPECIFIC ADDITIONS === */

/* Site Header (Sticky Calculator Nav) */
.site-header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

/* Navigation Links */
.main-nav {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Dropdowns */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle::after {
    content: '▾';
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    margin-top: 15px;
}

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

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
    padding-left: 25px;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

.tools-btn {
    background: var(--primary);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.2s;
}

.tools-btn:hover {
    background: #1e40af;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--dark);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 20px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-item {
    border-bottom: 1px solid #e2e8f0;
}

.mobile-nav-link {
    display: block;
    padding: 15px 0;
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
}

.mobile-dropdown-content {
    padding-left: 20px;
    display: none;
}

.mobile-dropdown-content.active {
    display: block;
}

.mobile-dropdown-content a {
    display: block;
    padding: 10px 0;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95em;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 15px 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 1em;
    color: var(--dark);
    cursor: pointer;
    text-align: left;
}

/* Breadcrumbs */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.9em;
    color: #64748b;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

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

.breadcrumb-separator {
    margin: 0 8px;
    color: #cbd5e0;
}

/* Calculator Panels */
.input-panel, .results-panel, .shape-selector, .category-selector, .quick-conversions {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s;
}

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

.input-row {
    display: flex;
    gap: 10px;
}

/* Shape/Category Buttons */
.shape-grid, .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.shape-btn, .category-btn {
    background: var(--light);
    border: 2px solid #e2e8f0;
    padding: 20px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--dark);
}

.shape-btn:hover, .category-btn:hover {
    background: var(--white);
    border-color: var(--primary);
}

.shape-btn.active, .category-btn.active {
    background: var(--primary);
    color: var(--white);
}

.shape-icon, .category-icon {
    font-size: 2.2em;
    display: block;
    margin-bottom: 8px;
}

/* Buttons */
.calculate-btn, .action-btn {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.calculate-btn:hover, .action-btn:hover {
    background: #1e40af;
}

/* Results */
.result-item, .quick-item {
    background: var(--light);
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9em;
}

.result-value {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary);
}

.formula-display {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 18px;
    border-radius: 8px;
    margin-top: 15px;
}

.formula-label {
    font-weight: 700;
    color: #f59e0b;
    font-size: 0.85em;
    margin-bottom: 6px;
}

.formula-text {
    font-size: 1em;
    color: var(--dark);
}

/* Layout */
.calculator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    max-width: 900px;
    margin: 30px auto 0;
}

.converter-panel {
    background: var(--light);
    padding: 30px;
    border-radius: 12px;
}

.converter-panel label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.converter-panel input,
.converter-panel select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.05em;
    margin-bottom: 15px;
    transition: all 0.2s;
}

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

.swap-btn {
    background: #10b981;
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
}

.swap-btn:hover {
    transform: rotate(180deg);
}

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

/* Footer */
.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
}

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

.footer-column h4 {
    font-size: 1.1em;
    color: var(--dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9em;
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-brand {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.footer-tagline {
    color: #64748b;
    line-height: 1.6;
    font-size: 0.9em;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
    color: #64748b;
    font-size: 0.9em;
}

.footer-bottom a {
    color: var(--primary);
    text-decoration: none;
}

/* === MOBILE RESPONSIVE (FROM MAIN SITE) === */

@media (max-width: 768px) {
    
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .container {
        padding: 20px 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .header-content, .header-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 15px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .hamburger, .mobile-menu-btn {
        display: flex !important;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 80px 20px 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav > a,
    .main-nav > .dropdown {
        display: block;
        padding: 15px 10px;
        border-bottom: 1px solid #e2e8f0;
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        margin-top: 10px;
        padding-left: 15px;
        display: none;
        background: var(--light);
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    .tool-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .tool-card {
        padding: 25px 20px;
    }
    
    .calculator-section {
        grid-template-columns: 1fr;
    }
    
    .converter-grid {
        grid-template-columns: 1fr;
    }
    
    .swap-btn {
        transform: rotate(90deg);
    }
    
    .shape-grid, .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    input[type="text"],
    input[type="number"],
    select {
        font-size: 16px !important;
    }
    
    .action-btn, .calculate-btn {
        min-height: 48px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 380px) {
    .logo {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
}
