:root {
    --primary: #27ae60;
    --primary-dark: #1e8449;
    --secondary: #2C3E50;
    --accent: #E74C3C;
    --bg-dark: #0d1f22;
    --bg-light: #132a30;
    --bg-card: #1a3a42;
    --text-primary: #ffffff;
    --text-secondary: #a0c4b8;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --border: #2a4a52;
}

:root.light-mode {
    --bg-dark: #f0f7f4;
    --bg-light: #ffffff;
    --bg-card: #e0ece8;
    --text-primary: #0d1f22;
    --text-secondary: #4a6b60;
    --border: #c0d4ce;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.scottrix-home-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.scottrix-home-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.theme-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
    margin-top: auto;
    flex-shrink: 0;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

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

.contact-link svg {
    width: 18px;
    height: 18px;
}

.nav-categories {
    list-style: none;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

.category {
    margin-bottom: 5px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 10px;
}

.category-header:hover {
    background: var(--bg-card);
}

.category-header .icon {
    font-size: 18px;
}

.category-header .arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.category-header.active .arrow {
    transform: rotate(180deg);
}

.nav-items {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-dark);
}

.nav-items.show {
    max-height: 500px;
}

.nav-items li a {
    display: block;
    padding: 10px 20px 10px 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-items li a:hover,
.nav-items li a.active {
    color: var(--text-primary);
    background: var(--bg-card);
    border-left: 3px solid var(--primary);
}

.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-dark);
}

.site-footer {
    padding: 15px 30px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.site-footer p {
    margin: 0;
}

.tool-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-panel.active {
    display: block;
}

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

.tool-panel h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

.tool-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border);
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

button {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.results-panel {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.results-panel h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.result-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
}

.result-item .label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 5px;
}

.result-item .value {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
}

.result-highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.result-highlight .label {
    color: rgba(255,255,255,0.8);
}

.result-highlight .value {
    color: white;
}

.tax-breakdown {
    margin-top: 20px;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.tax-row:last-child {
    border-bottom: none;
}

.tax-row .label {
    color: var(--text-secondary);
}

.tax-row .amount {
    color: var(--text-primary);
    font-weight: 500;
}

.tax-row.deduction .amount {
    color: var(--error);
}

.tax-row.income .amount {
    color: var(--success);
}

/* Currency Converter */
.converter-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.currency-input {
    flex: 1;
    min-width: 200px;
}

.currency-input input,
.currency-input select {
    margin-bottom: 10px;
}

.swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.rate-info {
    text-align: center;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Salary Converter */
.salary-conversions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.conversion-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversion-row label {
    color: var(--text-secondary);
    font-size: 13px;
}

.conversion-row input {
    background: var(--bg-dark);
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
}

.coming-soon .icon {
    font-size: 60px;
    display: block;
    margin-bottom: 20px;
}

.coming-soon p {
    color: var(--text-primary);
    font-size: 18px;
}

.coming-soon .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 10px;
}

/* Feature Grid */
.welcome-msg-desktop {
    margin-bottom: 20px;
}

.welcome-msg-mobile {
    display: none;
}

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

.feature-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.feature-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Chart Container */
.chart-container {
    margin-top: 20px;
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 20px;
}

/* Tax Year Selector */
.tax-year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tax-year-selector label {
    color: var(--text-secondary);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content {
        height: auto;
        min-height: calc(100vh - 60px);
        padding-top: 70px;
        padding-bottom: 20px;
    }

    body {
        flex-direction: column;
        overflow: auto;
    }

    .app-layout {
        flex-direction: column;
    }
    
    .site-footer {
        padding: 12px 15px;
        font-size: 12px;
    }

    .welcome-msg-desktop {
        display: none;
    }
    
    .welcome-msg-mobile {
        display: block;
        text-align: center;
        padding: 0 20px;
    }

    .converter-row {
        flex-direction: column;
    }

    .swap-btn {
        margin: 0 auto;
    }
}


.disclaimer-banner {
  background: var(--card-bg, #1e293b);
  border: 1px solid #ffad1f;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
}
.disclaimer-banner a {
  color: var(--primary, #1da1f2);
  text-decoration: underline;
}

.affiliate-section {
  margin: 1.5rem 0 0;
  padding: 1rem;
  border-top: 1px solid var(--border, #334155);
}
.affiliate-section h3 {
  font-size: 0.9rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 0.6rem;
}
.affiliate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}
 .affiliate-card {
   display: block;
   background: var(--card-bg, #1e293b);
   border: 1px solid var(--border, #334155);
   border-left: 3px solid #FF9900;
   border-radius: 8px;
   padding: 0.8rem;
   text-decoration: none;
   color: var(--text-primary, #e2e8f0);
   transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
 }
 .affiliate-card:hover {
   border-color: #FF9900;
   box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
   transform: translateY(-1px);
 }
 .affiliate-card-title {
   font-size: 0.9rem;
   font-weight: 700;
   margin-bottom: 0.3rem;
 }
 .affiliate-card-desc {
   font-size: 0.8rem;
   color: var(--text-secondary, #94a3b8);
   line-height: 1.4;
 }
 .affiliate-card-store {
   font-size: 0.75rem;
   color: #FF9900;
   margin-top: 0.3rem;
   font-weight: 600;
   display: flex;
   align-items: center;
   gap: 0.3rem;
 }
 .affiliate-card-store img {
   height: 14px;
   width: auto;
   vertical-align: middle;
 }
 .affiliate-card-urgency {
   font-size: 0.65rem;
   color: var(--error, #e0245e);
   margin-top: 0.2rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.5px;
 }
.affiliate-card[data-fastmail] .affiliate-card-icon {
  float: right;
  margin-left: 0.6rem;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  flex-shrink: 0;
}
 .fastmail-topbar {
   display: block;
   margin-bottom: 12px;
   text-decoration: none;
 }
 .fastmail-topbar[hidden] {
   display: none !important;
 }
 .fastmail-topbar img {
   display: block;
   width: 100%;
   max-width: 970px;
   height: auto;
   border-radius: 8px;
   margin: 0 auto;
   transition: box-shadow 0.2s, transform 0.15s;
 }
 .fastmail-topbar:hover img {
   box-shadow: 0 4px 16px rgba(139,92,246,0.35);
   transform: translateY(-1px);
 }
 .fastmail-topbar-icon {
   width: 20px;
   height: 20px;
   vertical-align: middle;
 }
.fastmail-topbar-text {
  color: #e0e7ff;
  font-weight: 600;
}
.fastmail-topbar-cta {
  color: #a78bfa;
  font-size: 0.75rem;
}
.fastmail-trademark {
  font-size: 0.65rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 0.3rem;
  line-height: 1.3;
}
.affiliate-disclaimer {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 0.6rem;
  line-height: 1.4;
}
.share-section { text-align: center; padding: 1.5rem 0; }
.share-buttons { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }
.share-btn { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; text-decoration: none; color: #fff; transition: opacity 0.2s; }
.share-btn:hover { opacity: 0.85; }
.share-twitter { background: #1DA1F2; }
.share-facebook { background: #1877F2; }
.share-linkedin { background: #0A66C2; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-copy { background: var(--card-bg, #1e293b); border: 1px solid var(--border, #334155); cursor: pointer; }
.related-topics .related-group { margin-bottom: 1rem; }
.related-topics h4 { font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--text-secondary, #94a3b8); }
.related-topics ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.related-topics li a { display: inline-block; padding: 0.25rem 0.6rem; background: var(--card-bg, #1e293b); border: 1px solid var(--border, #334155); border-radius: 4px; color: var(--text-primary, #e2e8f0); text-decoration: none; font-size: 0.8rem; transition: border-color 0.2s; }
.related-topics li a:hover { border-color: var(--primary, #4A90D9); }
