/*
 Theme Name:   UnitsCalculator Child
 Theme URI:    https://unitscalculator.net
 Description:  UnitsCalculator.net - Free Online Unit Converters & Calculators
 Author:       UnitsCalculator
 Author URI:   https://unitscalculator.net
 Template:     astra
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  unitscalculator
*/

/* ================================
   CSS VARIABLES
================================ */
:root {
    --uc-primary: #2563eb;
    --uc-primary-dark: #1d4ed8;
    --uc-secondary: #64748b;
    --uc-accent: #f59e0b;
    --uc-success: #10b981;
    --uc-bg-light: #f8fafc;
    --uc-bg-white: #ffffff;
    --uc-text-dark: #1e293b;
    --uc-text-light: #64748b;
    --uc-border: #e2e8f0;
    --uc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --uc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --uc-radius: 12px;
    --uc-radius-sm: 8px;
}

/* ================================
   BASE STYLES
=============================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--uc-text-dark);
    line-height: 1.6;
}

.uc-tool-page-wrapper,
.uc-homepage-wrapper {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, #eef6ff 0%, #f5f9ff 100%);
    min-height: 60vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--uc-text-dark);
    font-weight: 700;
}

/* ================================
   HEADER & NAVIGATION
=============================== */
.site-header {
    background: #dbeafe !important;
    border-bottom: 1px solid #bfdbfe;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    font-size: 24px;
    font-weight: 800;
    color: #1e3a5f;
    text-decoration: none;
}

.site-title a {
    color: #1e3a5f;
}

.site-title:hover {
    color: #1e40af;
}

/* Dropdown Menu Styles */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #ffffff;
    background: #2563eb;
    border-radius: 8px;
}

/* Dropdown */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--uc-bg-white);
    min-width: 220px;
    box-shadow: var(--uc-shadow-lg);
    border-radius: var(--uc-radius-sm);
    z-index: 1001;
}

.main-navigation ul li:hover > ul {
    display: block;
}

.main-navigation ul ul li {
    border-bottom: 1px solid var(--uc-border);
}

.main-navigation ul ul li:last-child {
    border-bottom: none;
}

.main-navigation ul ul a {
    padding: 10px 16px;
    font-size: 14px;
}

.main-navigation ul ul ul {
    left: 100%;
    top: 0;
}

/* ================================
   AD PLACEMENTS
================================ */
.uc-ad-container {
    text-align: center;
    margin: 20px auto;
    min-height: 90px;
    background: var(--uc-bg-light);
    border: 1px dashed var(--uc-border);
    border-radius: var(--uc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--uc-text-light);
    font-size: 12px;
}

.uc-ad-header {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
}

.uc-ad-sidebar {
    width: 300px;
    min-height: 250px;
}

.uc-ad-in-content {
    width: 100%;
    max-width: 336px;
    min-height: 280px;
}

/* ================================
   HOMEPAGE STYLES
================================ */
.uc-homepage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.uc-hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--uc-primary) 0%, var(--uc-primary-dark) 100%);
    color: white;
    border-radius: var(--uc-radius);
    margin-bottom: 40px;
}

.uc-hero h1 {
    color: white;
    font-size: 42px;
    margin-bottom: 16px;
}

.uc-hero p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.uc-categories-section {
    margin-bottom: 40px;
}

.uc-category-card {
    background: var(--uc-bg-white);
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s;
}

.uc-category-card:hover {
    box-shadow: var(--uc-shadow-lg);
}

.uc-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
}

.uc-category-icon {
    width: 48px;
    height: 48px;
    background: var(--uc-primary);
    color: white;
    border-radius: var(--uc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.uc-category-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--uc-text-dark);
}

.uc-category-count {
    font-size: 14px;
    color: var(--uc-text-light);
    background: var(--uc-bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.uc-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.uc-tool-link {
    display: block;
    padding: 12px 16px;
    background: var(--uc-bg-light);
    border-radius: var(--uc-radius-sm);
    color: var(--uc-text-dark);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.uc-tool-link:hover {
    background: var(--uc-primary);
    color: white;
    border-color: var(--uc-primary);
}

.uc-show-more {
    margin-top: 16px;
}

.uc-show-more-btn {
    background: transparent;
    border: 2px solid var(--uc-primary);
    color: var(--uc-primary);
    padding: 8px 20px;
    border-radius: var(--uc-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.uc-show-more-btn:hover {
    background: var(--uc-primary);
    color: white;
}

/* ================================
   TOOL PAGE STYLES
================================ */
.uc-tool-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.uc-tool-header {
    text-align: center;
    margin-bottom: 32px;
}

.uc-tool-title {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--uc-text-dark);
}

.uc-tool-category {
    display: inline-block;
    background: var(--uc-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.uc-calculator-card {
    background: var(--uc-bg-white);
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius);
    padding: 32px;
    box-shadow: var(--uc-shadow);
}

.uc-form-group {
    margin-bottom: 24px;
}

.uc-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--uc-text-dark);
}

.uc-input-wrapper {
    display: flex;
    gap: 12px;
}

.uc-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--uc-border);
    border-radius: var(--uc-radius-sm);
    font-size: 16px;
    transition: border-color 0.2s;
}

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

.uc-select {
    padding: 14px 16px;
    border: 2px solid var(--uc-border);
    border-radius: var(--uc-radius-sm);
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.uc-btn {
    background: var(--uc-primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--uc-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.uc-btn-secondary {
    background: var(--uc-secondary);
}

.uc-btn-secondary:hover {
    background: #475569;
}

.uc-result {
    background: var(--uc-bg-light);
    border: 2px solid var(--uc-primary);
    border-radius: var(--uc-radius);
    padding: 24px;
    text-align: center;
    margin-top: 24px;
    display: none;
}

.uc-result.show {
    display: block;
}

.uc-result-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--uc-primary);
}

.uc-result-label {
    font-size: 14px;
    color: var(--uc-text-light);
    margin-top: 4px;
}

.uc-formula-info {
    margin-top: 24px;
    padding: 16px;
    background: var(--uc-bg-light);
    border-radius: var(--uc-radius-sm);
    font-size: 14px;
    color: var(--uc-text-light);
}

.uc-formula-info strong {
    color: var(--uc-text-dark);
}

.uc-related-tools {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--uc-border);
}

.uc-related-tools h3 {
    margin-bottom: 16px;
}

.uc-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* ================================
   FOOTER STYLES
================================ */
.site-footer {
    background: var(--uc-text-dark);
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.uc-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.uc-footer-section h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 18px;
}

.uc-footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.uc-footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.uc-footer-section a:hover {
    color: white;
}

.uc-footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid #334155;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ================================
   RESPONSIVE STYLES
================================ */
@media (max-width: 768px) {
    .uc-hero h1 {
        font-size: 28px;
    }
    
    .uc-hero p {
        font-size: 16px;
    }
    
    .uc-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .uc-tool-title {
        font-size: 24px;
    }
    
    .uc-calculator-card {
        padding: 20px;
    }
    
    .uc-result-value {
        font-size: 28px;
    }
    
    .main-navigation ul {
        flex-direction: column;
    }
    
    .main-navigation ul ul {
        position: static;
        box-shadow: none;
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .uc-homepage {
        padding: 20px 12px;
    }
    
    .uc-hero {
        padding: 40px 16px;
    }
    
    .uc-tools-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .uc-input-wrapper {
        flex-direction: column;
    }
}

/* ================================
   UTILITY CLASSES
================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none; }
.visible { display: block; }