/* =========================================
   TOOLS
   ========================================= */
/* ==========================================================================
   Tools Panel (Compact in Contact Form)
   ========================================================================== */
.tools-panel {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tools-panel-heading {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.tools-scroll-container {
    flex-grow: 1;
    height: 0;
    min-height: 180px;
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    ::-webkit-scrollbar {
        display: none;
    }
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    
    /* Slight padding so hover effects don't get clipped */
    padding: 0.25rem;
    margin: -0.25rem;
}

.tools-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.tool-compact-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.tool-compact-card:hover {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
    color: var(--primary);
}

.tool-compact-card svg {
    color: var(--primary);
    opacity: 0.8;
    transition: opacity var(--transition), transform var(--transition);
}

.tool-compact-card:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.tool-compact-card span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==========================================================================
   IP Calculator Modal
   ========================================================================== */











.ip-calc-form {
    margin-bottom: 2rem;
}

.form-group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: flex-end;
}

.subnet-form-row {
    grid-template-columns: 1fr 1fr 1fr auto;
    padding: 0.5rem 0; /* Proper padding for input section */
    gap: 1rem; /* Consistent gap */
}

/* Remove any min-width that causes overlap */
.subnet-form-row .form-group {
    min-width: 0 !important;
    width: 100%;
}

/* Ensure all labels align perfectly */
.subnet-form-row .form-group label {
    display: block;
    margin-bottom: 0.35rem;
}

/* Ensure identical heights */
.subnet-form-row .form-group input {
    height: 48px;
    box-sizing: border-box;
}

.subnet-form-row .calc-btn {
    height: 48px;
    box-sizing: border-box;
    margin-bottom: 0;
    align-self: flex-end;
}

/* Radio buttons row */
.radio-group-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
}

.radio-label input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-group-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.form-group-row .form-group input {
    height: 48px;
}

.calc-btn {
    padding: 0.8rem 1.5rem;
    height: 48px; /* Match input height */
    margin-bottom: 0;
}

.calc-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    animation: fadeIn 0.3s ease-out forwards;
}

.calc-result-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.calc-result-item.full-width {
    grid-column: 1 / -1;
}

.calc-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.calc-value {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text);
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), color var(--transition);
    padding: 0.25rem;
}

.calc-result-item:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--primary);
}

/* ========================================================================== 
   CCTV Storage Calculator
   ========================================================================== */
.cctv-modal-container { max-width: 940px; }
.cctv-form { margin-bottom: 1.5rem; }
.cctv-input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cctv-input-grid .form-group { margin: 0; min-width: 0; }
.cctv-input-grid label { display: block; margin-bottom: .45rem; color: var(--text); font-size: .9rem; font-weight: 500; }
.cctv-input-grid input, .cctv-input-grid select { width: 100%; min-height: 44px; padding: .7rem .8rem; color: var(--text); background: rgba(15, 23, 42, .55); border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; }
.cctv-input-grid select option { background: var(--surface); color: var(--text); }
.cctv-input-grid input:focus, .cctv-input-grid select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.cctv-help { display: block; min-height: 1.15rem; margin-top: .35rem; color: var(--primary-hover); font-size: .75rem; }
.cctv-note { margin: 1rem 0 0; padding: .75rem .9rem; color: var(--text-muted); background: rgba(59, 130, 246, .06); border: 1px solid rgba(59, 130, 246, .15); border-radius: var(--radius-md); font-size: .82rem; line-height: 1.5; }
.cctv-error { display: none; margin-top: 1rem; padding: .75rem .9rem; color: #fca5a5; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .3); border-radius: var(--radius-md); }
.cctv-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.cctv-results { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1.5rem; }
.cctv-result-card { padding: 1rem; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: var(--radius-md); }
.cctv-result-card span { display: block; color: var(--text-muted); font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cctv-result-card strong { display: block; margin-top: .4rem; color: var(--text); font-family: monospace; font-size: 1.1rem; }
.cctv-result-card.prominent { background: linear-gradient(145deg, rgba(59,130,246,.2), rgba(124,58,237,.12)); border-color: rgba(96,165,250,.45); }
.cctv-result-card.prominent strong { color: #dbeafe; font-size: 1.35rem; }
.cctv-details { margin-top: 1.25rem; padding: 1rem; background: rgba(15,23,42,.35); border: 1px dashed rgba(255,255,255,.14); border-radius: var(--radius-md); }
.cctv-details summary { color: var(--text); cursor: pointer; font-weight: 600; }
.cctv-details summary::marker { color: var(--primary); }
.cctv-details-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem 1rem; margin-top: 1rem; color: var(--text-muted); font-size: .88rem; }
.cctv-details-content div { display: flex; justify-content: space-between; gap: .75rem; border-bottom: 1px solid rgba(255,255,255,.05); padding-bottom: .35rem; }
.cctv-details-content b { color: var(--text); font-weight: 500; text-align: right; }

@media (max-width: 1024px) {
    .subnet-form-row {
        grid-template-columns: 1fr 1fr;
    }
    .subnet-form-row .calc-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .calc-results-grid {
        grid-template-columns: 1fr;
    }
    .form-group-row {
        grid-template-columns: 1fr;
    }
    .subnet-form-row {
        grid-template-columns: 1fr;
    }
    .subnet-form-row .calc-btn {
        grid-column: auto;
    }
    .radio-group-row {
        flex-direction: column;
        align-items: center; /* Center on mobile */
        gap: 1rem;
    }
    .cctv-input-grid, .cctv-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .cctv-input-grid, .cctv-results, .cctv-details-content { grid-template-columns: 1fr; }
    .cctv-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   Password Generator Modal
   ========================================================================== */
.pg-display-box {
    position: relative;
    margin-bottom: 1.5rem;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pg-output {
    width: 100%;
    padding: 1.25rem 6rem 1.25rem 1.25rem;
    font-size: 1.5rem;
    font-family: monospace;
    color: var(--text);
    background: transparent;
    border: none;
    letter-spacing: 2px;
}

.pg-output:focus {
    outline: none;
}

.pg-actions {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.pg-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.pg-icon-btn:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

/* Strength Meter */
.pg-strength-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.pg-strength-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
}

.pg-strength-bars {
    display: flex;
    gap: 6px;
    height: 12px;
}

.pg-bar {
    width: 25px;
    height: 100%;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.pg-bar.active-weak { background-color: #ef4444; }
.pg-bar.active-fair { background-color: #f59e0b; }
.pg-bar.active-good { background-color: #3b82f6; }
.pg-bar.active-strong { background-color: #10b981; }

/* Length Control */
.pg-length-control {
    margin-bottom: 1.5rem;
}

.pg-length-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.pg-length-val {
    color: var(--primary);
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
}

.pg-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.pg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    transition: transform 0.1s;
}

.pg-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    transition: transform 0.1s;
}

.pg-slider::-webkit-slider-thumb:hover,
.pg-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Options Grid */
.pg-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 480px) {
    .pg-options-grid {
        grid-template-columns: 1fr;
    }
}

.pg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
    user-select: none;
}

.pg-checkbox-label input {
    display: none;
}

.pg-custom-check {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
}

.pg-checkbox-label input:checked + .pg-custom-check {
    background-color: var(--primary);
    border-color: var(--primary);
}
.pg-checkbox-label input:checked + .pg-custom-check::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}


/* ==========================================================================
   Word Counter Modal
   ========================================================================== */
.wc-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wc-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    height: auto;
    border-radius: var(--radius-sm);
}

.wc-textarea {
    width: 100%;
    height: 180px;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.wc-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.wc-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.wc-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1.5rem;
}

.wc-analysis-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.wc-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wc-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 2px;
}

.wc-analysis-container .wc-stats-grid {
    margin-bottom: 0;
}

.wc-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wc-keyword-item {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.wc-keyword-item span {
    background-color: rgba(59, 130, 246, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
    color: #fff;
}

.wc-keyword-item.empty {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .wc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wc-stats-grid {
        grid-template-columns: 1fr;
    }
    .wc-top-actions {
        flex-wrap: wrap;
    }
    .wc-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   QR Generator Modal
   ========================================================================== */
.qr-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.qr-select {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

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

.qr-select option {
    background-color: #0f172a;
    color: white;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    height: 44px;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.color-hex {
    margin-left: 0.75rem;
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text);
}

.qr-preview-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-preview-box {
    background-color: white; /* Always white so QR is visible if no bg specified */
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

#qr-canvas-wrapper canvas,
#qr-canvas-wrapper svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.qr-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.qr-info-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

@media (max-width: 768px) {
    .qr-options-grid,
    .qr-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Unit Converter Modal
   ========================================================================== */
.uc-form-container {
    display: flex;
    flex-direction: column;
}

.uc-select {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    transition: border-color var(--transition);
}

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

.uc-select option {
    background-color: #0f172a;
    color: white;
}

.uc-conversion-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.uc-conversion-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.uc-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.uc-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.uc-input {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 1.1rem;
    font-family: monospace;
    transition: border-color var(--transition);
}

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

.uc-input-readonly {
    background-color: rgba(15, 23, 42, 0.3);
    color: var(--primary);
    font-weight: 600;
}

.uc-swap-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.uc-swap-btn {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.uc-swap-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: rotate(180deg);
}

.uc-formula-container {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.95rem;
}

@media (max-width: 480px) {
    .uc-conversion-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   Base Converter Modal
   ========================================================================== */
.bc-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bc-result-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color var(--transition);
}

.bc-result-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.bc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bc-result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.bc-result-value {
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--primary);
    word-break: break-all;
    min-height: 1.5rem;
}

.bc-how-it-works {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.bc-details {
    padding: 1rem;
}

.bc-details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    outline: none;
    list-style: none; /* Hide default arrow in some browsers */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bc-details summary::-webkit-details-marker {
    display: none;
}

.bc-details summary::before {
    content: '▶';
    font-size: 0.8rem;
    color: var(--primary);
    transition: transform 0.2s;
}

.bc-details[open] summary::before {
    transform: rotate(90deg);
}

.bc-details-content {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.bc-details-content p {
    margin-bottom: 0.5rem;
}

.bc-details-content ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.bc-details-content li {
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    .bc-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CV Builder Modal & Document Styling
   ========================================================================== */
.cv-builder-body {
    display: grid !important;
    grid-template-columns: 380px minmax(0, 1fr);
    overflow: hidden !important;
    padding: 0 !important;
    height: 100%;
}

@media (max-width: 900px) {
    .cv-builder-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto !important;
    }
}

.cv-form-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    box-sizing: border-box;
}

/* Custom scrollbar for form panel */
.cv-form-panel::-webkit-scrollbar {
    width: 6px;
}
.cv-form-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.cv-form-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.cv-form-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cv-form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    width: 100%;
}

.cv-form-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.cv-preview-panel {
    background: #e2e8f0; /* Soft gray backdrop for A4 preview */
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: auto;
    height: 100%;
    box-sizing: border-box;
    box-shadow: inset 1px 0 10px rgba(0, 0, 0, 0.1);
}

.cv-preview-wrapper {
    display: flex;
    justify-content: center;
}

/* 
   A4 Document Proportions 
   Width: 210mm
   Height: naturally expands, but min-height is 297mm for visual reference.
*/
.cv-document {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 10pt;
    line-height: 1.5;
    box-sizing: border-box;
    position: relative;
    display: flex; /* Two-column layout */
    flex-direction: row;
}

/* LEFT SIDEBAR */
.cv-left-column {
    width: 38%;
    background-color: #2a3b5c; /* Dark charcoal/gray */
    color: #f1f5f9;
    padding: 20mm 12mm;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.cv-profile-box {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cv-photo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #3b82f6; /* Light blue accent */
    background: #1e293b;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cv-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-left-column .cv-name {
    font-size: 20pt;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.cv-left-column .cv-title {
    font-size: 11pt;
    color: #3b82f6;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cv-side-section {
    margin-bottom: 2rem;
}

.cv-side-title {
    font-size: 11pt;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cv-contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cv-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 9pt;
    color: #cbd5e1;
    word-break: break-all;
}

.cv-contact-item svg {
    color: #3b82f6;
    flex-shrink: 0;
}

.cv-info-label {
    font-weight: 600;
    color: #f1f5f9;
}

/* RIGHT CONTENT */
.cv-right-column {
    width: 62%;
    background-color: #ffffff;
    padding: 20mm 15mm;
    box-sizing: border-box;
}

.cv-main-section {
    margin-bottom: 1.8rem;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cv-main-title {
    display: flex;
    align-items: center;
    font-size: 14pt;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 5px;
    border-bottom: 1px solid #cbd5e1;
}

.cv-main-icon {
    color: #3b82f6;
    margin-right: 8px;
}

.cv-summary-text {
    font-size: 10pt;
    color: #334155;
    text-align: justify;
}

/* Timeline & Entries */
.cv-timeline-item, .cv-side-item {
    margin-bottom: 1.2rem;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cv-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.cv-timeline-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 11pt;
}

.cv-side-item .cv-timeline-title {
    color: #ffffff;
    font-size: 10pt;
}

.cv-timeline-date {
    font-size: 9pt;
    color: #3b82f6;
    font-weight: 600;
}

.cv-timeline-subtitle {
    font-size: 10pt;
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.cv-side-item .cv-timeline-subtitle {
    color: #cbd5e1;
    font-size: 9pt;
}

.cv-timeline-desc {
    font-size: 9.5pt;
    color: #475569;
}

.cv-side-item .cv-timeline-desc {
    color: #94a3b8;
}

.cv-timeline-desc ul {
    margin-top: 4px;
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.cv-timeline-desc li {
    margin-bottom: 3px;
}

/* Skills Formatting */
.cv-skills-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9.5pt;
    color: #334155;
}

.cv-skill-name {
    font-weight: 500;
    flex: 1;
}

.cv-skill-bar-bg {
    width: 50%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.cv-skill-bar-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 3px;
}

.cv-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cv-skill-tag {
    background: #f1f5f9;
    color: #334155;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 9.5pt;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* Dynamic Input Sets inside Form */
.cv-exp-entry, .cv-edu-entry {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.cv-remove-entry {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 1024px) {
    .cv-builder-body {
        flex-direction: column;
    }
    .cv-form-panel, .cv-preview-panel {
        max-width: 100%;
        width: 100%;
    }
    .cv-document {
        width: 100%; /* Scale down on smaller screens visually */
        transform-origin: top center;
        /* Using zoom or scale can mess with html2pdf, but we rely on a wrapper */
    }
}

