/* ============================================================
   importtemplates.css — Shell Stylesheet
   CCH SureTax Developer Portal · Import Templates Section
   Layout: Fixed header + fixed sidebar + scrollable content pane.
   The overview (tile gallery) is inline; detail pages load in an
   iframe that fills the content pane.
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --wk-blue: #007AC3;
    --wk-blue-medium: #409BD2;
    --wk-blue-light: #A6D0EA;
    --wk-blue-ultra-light: #E8F4FB;
    --wk-green: #5A8A15;
    --wk-green-medium: #7BAA3C;
    --wk-teal: #00A3A1;
    --wk-teal-medium: #33B8B6;
    --wk-teal-light: #B2DFDB;
    --wk-teal-ultra-light: #E0F2F1;
    --wk-orange: #FF6B35;
    --wk-red: #E5202E;
    --wk-purple: #6B21A8;
    --card-border-color: rgba(0, 0, 0, 0.3);
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --header-height: 56px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- Base ---------- */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

a { color: var(--wk-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.header-logo:hover { text-decoration: none; }

.logo-mark {
    background: var(--wk-blue);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
}

.logo-img {
    height: 28px;
    width: auto;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-nav a {
    color: rgba(255,255,255,0.8);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.primary-nav a:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.primary-nav a.active { color: white; background: rgba(255,255,255,0.15); }

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 6px;
}

.help-link {
    color: rgba(255,255,255,0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.help-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.help-link svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Page Container ---------- */
.page-container {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
}

/* ---------- Sidebar ---------- */
.sidebar-nav {
    width: 260px;
    min-width: 260px;
    padding: 24px 16px;
    border-right: 1px solid var(--gray-200);
    background: white;
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 20px; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li { margin: 0; padding: 0; }

.sidebar-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    margin-bottom: 8px;
    padding: 0 12px;
}

.sidebar-nav a {
    display: block;
    padding: 6px 12px;
    color: var(--gray-600);
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-nav a:hover { color: var(--wk-teal); background: var(--wk-teal-ultra-light); text-decoration: none; }
.sidebar-nav a.active { color: var(--wk-teal); background: var(--wk-teal-ultra-light); font-weight: 600; }

/* ---------- Content Pane ---------- */
.content-pane {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* ---------- Overview Content ---------- */
.overview-content {
    padding: 32px 48px;
    max-width: 1100px;
}

.overview-content.hidden { display: none; }

/* ---------- Detail Iframe ---------- */
.detail-frame {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
}

.detail-frame.visible { display: block; }

/* ---------- Typography ---------- */
h1 {
    color: var(--wk-teal);
    font-size: 28pt;
    font-weight: 700;
    margin-bottom: 12px;
}

h2 {
    font-size: 18pt;
    color: var(--gray-800);
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-top: 20px;
    border-top: 2px solid var(--wk-teal);
}

h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

.lead {
    font-size: 13pt;
    color: var(--gray-600);
    margin-bottom: 32px;
    line-height: 1.7;
}

p { margin-bottom: 16px; }
ol, ul { margin-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 6px; }

/* ---------- Tile Grid ---------- */
.tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 32px;
}

/* ---------- Tiles ---------- */
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 210px;
    min-height: 260px;
    border: 1px solid #6B6B6B;
    border-radius: 10px;
    padding: 16px 14px;
    background-color: white;
    background-image: linear-gradient(to bottom right, white, #F0FDFA);
    cursor: pointer;
    text-decoration: none;
    color: var(--gray-800);
    transition: border-color 0.2s, border-width 0.15s, box-shadow 0.2s;
}

.tile:hover {
    border-width: 2px;
    border-color: var(--wk-teal-medium);
    box-shadow: 0 0 0 1px var(--wk-teal), 5px 5px 10px rgba(51, 184, 182, 0.25);
    text-decoration: none;
}

.tile:hover .tile-btn {
    background: linear-gradient(135deg, var(--wk-teal), var(--wk-teal-medium));
    color: white;
    border-color: var(--wk-teal);
}

.tile-title {
    text-align: center;
    font-size: 11pt;
    font-weight: 700;
    color: var(--gray-900);
    padding: 4px 4px 8px;
    line-height: 1.3;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Tile Icon Box ---------- */
.tile-icon-box {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tile-icon-box svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.tile-icon-box.template { background: linear-gradient(135deg, var(--wk-teal), var(--wk-teal-medium)); }

.tile-desc {
    text-align: center;
    font-size: 8.5pt;
    color: var(--gray-600);
    line-height: 1.5;
    padding: 0 2px;
    flex: 1;
}

/* ---------- Tile Button ---------- */
.tile-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 18px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 9pt;
    font-weight: 600;
    color: var(--gray-600);
    background: white;
    transition: all 0.2s;
}

/* ---------- Callout ---------- */
.callout {
    border-left: 4px solid var(--wk-teal);
    background: var(--wk-teal-ultra-light);
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    margin-top: 32px;
}

.callout h4 {
    font-size: 11pt;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.callout p { margin-bottom: 0; font-size: 10pt; color: var(--gray-600); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar-nav { display: none; }
    .overview-content { padding: 24px 20px; }
    .tile-grid { justify-content: center; }
    .tile { width: 100%; max-width: 280px; }
    .primary-nav { display: none; }
}

/* ---------- Sidebar Collapsible Groups ---------- */
.sidebar-group-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    user-select: none;
    transition: background 0.15s, color 0.15s;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.sidebar-group-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.toggle-chevron {
    width: 10px;
    height: 10px;
    fill: currentColor;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-group-toggle.open .toggle-chevron {
    transform: rotate(90deg);
}

.sidebar-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}

.sidebar-group-list.collapsed {
    max-height: 0;
}

/* ---------- Tile Group Headings ---------- */
.tile-group {
    margin-bottom: 32px;
}

.tile-group-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13pt;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0 0 4px 0;
    padding: 10px 0 8px;
    border-bottom: 2px solid var(--wk-teal-light);
    border-top: none;
}

.tile-group-heading .group-icon {
    width: 22px;
    height: 22px;
    fill: var(--wk-teal);
    flex-shrink: 0;
}
