/*
Theme Name: GoCalc
Theme URI: https://ictflare.com
Author: ICTFLARE
Author URI: https://ictflare.com
Description: A lightweight three-column Bootstrap WordPress theme optimized for calculators, tools, and Google AdSense monetization.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gocalc
Tags: three-columns, custom-logo, custom-menu, widgets, responsive-layout, bootstrap
*/

/* =============================================
   GoCalc Theme - Base Styles
   ============================================= */

:root {
    --gocalc-primary:     #2563eb;
    --gocalc-primary-dark:#1d4ed8;
    --gocalc-secondary:   #64748b;
    --gocalc-accent:      #f59e0b;
    --gocalc-bg:          #f8fafc;
    --gocalc-surface:     #ffffff;
    --gocalc-border:      #e2e8f0;
    --gocalc-text:        #1e293b;
    --gocalc-text-muted:  #64748b;
    --gocalc-navbar-bg:   #1e293b;
    --gocalc-footer-bg:   #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--gocalc-bg);
    color: var(--gocalc-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--gocalc-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gocalc-primary-dark);
    text-decoration: underline;
}

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

/* =============================================
   Header
   ============================================= */

.gocalc-header {
    background: var(--gocalc-surface);
    border-bottom: 1px solid var(--gocalc-border);
    padding: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.gocalc-site-branding:hover {
    text-decoration: none;
}

.custom-logo {
    max-height: 56px;
    width: auto;
}

.gocalc-site-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gocalc-primary);
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.5px;
}

.gocalc-site-title span {
    color: var(--gocalc-accent);
}

.gocalc-tagline {
    font-size: 0.78rem;
    color: var(--gocalc-text-muted);
    margin: 0;
}

/* Header Ad Banner */
.gocalc-header-ad {
    text-align: center;
}

.gocalc-header-ad .ad-label {
    font-size: 0.65rem;
    color: var(--gocalc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

/* =============================================
   Navigation
   ============================================= */

.gocalc-navbar {
    background: var(--gocalc-navbar-bg) !important;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gocalc-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.1rem;
    display: none; /* hidden when full header is present */
}

.gocalc-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 14px 16px !important;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

.gocalc-navbar .nav-link:hover,
.gocalc-navbar .nav-link:focus,
.gocalc-navbar .nav-link.active {
    color: #fff !important;
}

.gocalc-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--gocalc-accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.gocalc-navbar .nav-link:hover::after,
.gocalc-navbar .nav-link.active::after {
    transform: scaleX(1);
}

.gocalc-navbar .dropdown-menu {
    background: var(--gocalc-navbar-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 8px 8px;
    border-top: 2px solid var(--gocalc-primary);
    margin-top: 0 !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
    padding: 6px 0;
    min-width: 200px;

    /* Smooth slide-down animation */
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

/* Show state — triggered by JS on hover + click */
.gocalc-navbar .dropdown-menu.show,
.gocalc-navbar .nav-item.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.gocalc-navbar .dropdown-item {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 9px 18px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.gocalc-navbar .dropdown-item:hover,
.gocalc-navbar .dropdown-item:focus {
    background: rgba(255,255,255,0.07);
    color: #fff;
    border-left-color: var(--gocalc-primary);
}

.gocalc-navbar .dropdown-item.active,
.gocalc-navbar .dropdown-item:active {
    background: var(--gocalc-primary);
    color: #fff;
    border-left-color: var(--gocalc-primary);
}

/* Dropdown toggle arrow animation */
.gocalc-navbar .dropdown-toggle::after {
    border: none;
    content: '\F282'; /* Bootstrap Icons chevron-down */
    font-family: 'bootstrap-icons';
    font-size: 0.65rem;
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.gocalc-navbar .nav-item.dropdown:hover > .nav-link::after,
.gocalc-navbar .nav-item.dropdown.show > .nav-link::after {
    transform: rotate(180deg);
}

/* Divider inside dropdown */
.gocalc-navbar .dropdown-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 4px 0;
}

/* Dropdown header label */
.gocalc-navbar .dropdown-header {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 18px 4px;
}

/* Mobile: no hover, keep click behaviour, full-width items */
@media (max-width: 991.98px) {
    .gocalc-navbar .dropdown-menu {
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: none; /* Bootstrap handles show/hide on mobile */
        transition: none;
    }
    .gocalc-navbar .dropdown-menu.show {
        display: block;
    }
    .gocalc-navbar .nav-item.dropdown:hover > .dropdown-menu {
        display: none; /* disable hover on mobile */
    }
    .gocalc-navbar .nav-item.dropdown.show > .dropdown-menu {
        display: block;
    }
    .gocalc-navbar .dropdown-item {
        padding: 8px 28px;
        border-left: none;
    }
}

.gocalc-navbar .navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.gocalc-navbar .navbar-toggler-icon {
    filter: invert(1);
}

/* Search form in navbar (via widget) */
.gocalc-nav-search .form-control,
.navbar-search-widget .form-control {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.85rem;
}

.gocalc-nav-search .form-control::placeholder,
.navbar-search-widget .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.gocalc-nav-search .btn-search,
.navbar-search-widget .btn-search,
.navbar-search-widget .search-submit {
    background: var(--gocalc-primary);
    border: none;
    color: #fff;
    padding: 6px 12px;
}

/* =============================================
   Breadcrumb
   ============================================= */

.gocalc-breadcrumb-wrap {
    background: var(--gocalc-surface);
    border-bottom: 1px solid var(--gocalc-border);
    padding: 8px 0;
}

.gocalc-breadcrumb-wrap .breadcrumb {
    background: none;
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
}

.gocalc-breadcrumb-wrap .breadcrumb-item a {
    color: var(--gocalc-primary);
}

.gocalc-breadcrumb-wrap .breadcrumb-item.active {
    color: var(--gocalc-text-muted);
}

/* =============================================
   Main Layout
   ============================================= */

.gocalc-main-wrap {
    padding: 28px 0;
}

/* =============================================
   Content Area
   ============================================= */

.gocalc-content {
    background: var(--gocalc-surface);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* In-content ad */
.gocalc-incontent-ad {
    margin: 20px 0;
    text-align: center;
    padding: 8px;
    background: var(--gocalc-bg);
    border-radius: 6px;
    border: 1px dashed var(--gocalc-border);
}

/* =============================================
   Post / Article Styles
   ============================================= */

.entry-header {
    padding: 24px 28px 0;
}

.entry-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--gocalc-text);
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.entry-title a {
    color: inherit;
}

.entry-title a:hover {
    color: var(--gocalc-primary);
    text-decoration: none;
}

.entry-meta {
    font-size: 0.8rem;
    color: var(--gocalc-text-muted);
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.entry-meta a {
    color: var(--gocalc-text-muted);
}

.entry-meta a:hover {
    color: var(--gocalc-primary);
}

.entry-meta .badge-category {
    background: var(--gocalc-primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-thumbnail {
    margin: 16px 0 0;
}

.post-thumbnail img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
}

.entry-content {
    padding: 20px 28px 24px;
    font-size: 0.96rem;
}

.entry-content h2 { font-size: 1.35rem; font-weight: 700; margin-top: 1.6rem; color: var(--gocalc-text); }
.entry-content h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4rem; color: var(--gocalc-text); }
.entry-content h4 { font-size: 1rem;    font-weight: 700; margin-top: 1.2rem; color: var(--gocalc-text); }

.entry-content p { margin-bottom: 1rem; }

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--gocalc-primary);
    padding: 12px 20px;
    margin: 1.5rem 0;
    background: rgba(37,99,235,0.05);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--gocalc-text-muted);
}

.entry-content code {
    background: rgba(37,99,235,0.08);
    color: var(--gocalc-primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

.entry-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.2rem 0;
}

.entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 0.9rem;
}

.entry-content table th {
    background: var(--gocalc-primary);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
}

.entry-content table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gocalc-border);
}

.entry-content table tr:nth-child(even) td {
    background: rgba(37,99,235,0.03);
}

.entry-footer {
    padding: 12px 28px 20px;
    border-top: 1px solid var(--gocalc-border);
    font-size: 0.82rem;
    color: var(--gocalc-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.entry-footer .tags a {
    display: inline-block;
    background: var(--gocalc-bg);
    border: 1px solid var(--gocalc-border);
    color: var(--gocalc-text-muted);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin: 2px;
    transition: all 0.2s;
}

.entry-footer .tags a:hover {
    background: var(--gocalc-primary);
    border-color: var(--gocalc-primary);
    color: #fff;
    text-decoration: none;
}

/* =============================================
   Post Navigation
   ============================================= */

.post-navigation {
    padding: 20px 28px;
    border-top: 1px solid var(--gocalc-border);
}

.post-navigation .nav-previous a,
.post-navigation .nav-next a {
    color: var(--gocalc-primary);
    font-size: 0.88rem;
    font-weight: 500;
}

/* =============================================
   Archive / Blog Loop
   ============================================= */

.gocalc-post-card {
    background: var(--gocalc-surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    margin-bottom: 20px;
    border: 1px solid var(--gocalc-border);
}

.gocalc-post-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.gocalc-post-card .card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gocalc-post-card .card-body {
    padding: 18px;
}

.gocalc-post-card .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.35;
}

.gocalc-post-card .card-title a {
    color: var(--gocalc-text);
}

.gocalc-post-card .card-title a:hover {
    color: var(--gocalc-primary);
    text-decoration: none;
}

.gocalc-post-card .card-excerpt {
    font-size: 0.86rem;
    color: var(--gocalc-text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gocalc-post-card .card-meta {
    font-size: 0.75rem;
    color: var(--gocalc-text-muted);
}

.btn-read-more {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 5px;
}

/* =============================================
   Sidebar
   ============================================= */

.gocalc-sidebar {
    position: relative;
}

.gocalc-sidebar-sticky {
    position: sticky;
    top: 20px;
}

.widget {
    background: var(--gocalc-surface);
    border-radius: 10px;
    border: 1px solid var(--gocalc-border);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.widget-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gocalc-text-muted);
    padding: 12px 16px 8px;
    border-bottom: 2px solid var(--gocalc-primary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-title::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--gocalc-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.widget-content {
    padding: 14px 16px;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    border-bottom: 1px solid var(--gocalc-border);
    padding: 7px 0;
    font-size: 0.86rem;
}

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

.widget ul li a {
    color: var(--gocalc-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget ul li a:hover {
    color: var(--gocalc-primary);
    text-decoration: none;
}

/* Ad widget */
.widget-ad {
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
}

.sidebar-ad-label {
    font-size: 0.65rem;
    color: var(--gocalc-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

/* Search widget */
.widget-search .search-form {
    display: flex;
    gap: 6px;
}

.widget-search .search-field {
    flex: 1;
    border: 1px solid var(--gocalc-border);
    background: var(--gocalc-bg);
    color: var(--gocalc-text);
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 0.85rem;
}

.widget-search .search-submit {
    background: var(--gocalc-primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* =============================================
   Pagination
   ============================================= */

.gocalc-pagination {
    margin-top: 24px;
}

.gocalc-pagination .page-link {
    color: var(--gocalc-primary);
    border-color: var(--gocalc-border);
    background: var(--gocalc-surface);
}

.gocalc-pagination .page-item.active .page-link {
    background: var(--gocalc-primary);
    border-color: var(--gocalc-primary);
}

/* =============================================
   Comments
   ============================================= */

.comment-area {
    padding: 20px 28px;
    border-top: 1px solid var(--gocalc-border);
}

.comment-area h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* =============================================
   404 & Search Result Styles
   ============================================= */

.gocalc-404 {
    text-align: center;
    padding: 60px 20px;
}

.gocalc-404 .error-code {
    font-size: 7rem;
    font-weight: 900;
    color: var(--gocalc-primary);
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--gocalc-primary), var(--gocalc-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gocalc-404 h2 {
    font-size: 1.4rem;
    color: var(--gocalc-text);
    margin-bottom: 12px;
}

.gocalc-404 p {
    color: var(--gocalc-text-muted);
    max-width: 400px;
    margin: 0 auto 24px;
}

/* =============================================
   Footer
   ============================================= */

.gocalc-footer-ad-wrap {
    background: var(--gocalc-surface);
    border-top: 1px solid var(--gocalc-border);
    padding: 16px 0;
    text-align: center;
}

.gocalc-footer {
    background: var(--gocalc-footer-bg);
    color: rgba(255,255,255,0.75);
    padding: 40px 0 0;
}

.gocalc-footer h5 {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gocalc-primary);
    display: inline-block;
}

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

.gocalc-footer ul li {
    margin-bottom: 6px;
}

.gocalc-footer ul li a {
    color: rgba(255,255,255,0.65);
    font-size: 0.86rem;
    transition: color 0.2s;
}

.gocalc-footer ul li a:hover {
    color: #fff;
    text-decoration: none;
}

.gocalc-footer p {
    font-size: 0.86rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
}

.gocalc-footer-bottom {
    background: rgba(0,0,0,0.25);
    margin-top: 30px;
    padding: 14px 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.gocalc-footer-bottom a {
    color: rgba(255,255,255,0.7);
}

.gocalc-footer-bottom a:hover {
    color: #fff;
}

/* =============================================
   Utilities
   ============================================= */

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .gocalc-sidebar-sticky {
        position: static;
    }
    .gocalc-main-wrap .row > [class*="col-"] + [class*="col-"] {
        margin-top: 20px;
    }
    .entry-header,
    .entry-content,
    .entry-footer,
    .post-navigation,
    .comment-area {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 767.98px) {
    .gocalc-site-title {
        font-size: 1.3rem;
    }
    .entry-title {
        font-size: 1.35rem;
    }
    .gocalc-404 .error-code {
        font-size: 5rem;
    }
}
