body{
    background:
        radial-gradient(circle at top left, rgba(13,110,253,.08), transparent 35%),
        radial-gradient(circle at top right, rgba(102,126,234,.06), transparent 30%),
        #f5f7fb;
    color:#1f2937;
}

body.tt-dark{ background:#0d1117; color:#c9d1d9; }
body.tt-dark .navbar, body.tt-dark .bg-light, body.tt-dark .bg-white{ background:#0b1220!important; }
body.tt-dark .tool-tab { color: #c9d1d9; }

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.02em;
}

body.tt-dark .navbar-brand {
    color: #ffffff !important;
}

body.tt-dark .navbar-brand:hover,
body.tt-dark .navbar-brand:focus {
    color: #ffffff !important;
}

body.tt-dark .nav-link {
    color: #c9d1d9 !important;
}

body.tt-dark .nav-link:hover,
body.tt-dark .nav-link:focus {
    color: #ffffff !important;
}

body.tt-dark .nav-link.active {
    color: #0d6efd !important;
}

body.tt-dark .dropdown-menu {
    background: #161b22 !important;
    border-color: #30363d !important;
}

body.tt-dark .dropdown-item {
    color: #c9d1d9 !important;
}

body.tt-dark .dropdown-item:hover,
body.tt-dark .dropdown-item:focus {
    background: #0d6efd !important;
    color: #ffffff !important;
}

body.tt-dark .form-check-label {
    color: #c9d1d9 !important;
}

.hero-panel {
    background: linear-gradient(135deg, rgba(13,110,253,.08), rgba(32,201,151,.08));
    border: 1px solid rgba(13,110,253,.12);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.06);
}

body.tt-dark .hero-panel {
    background: linear-gradient(135deg, rgba(13,110,253,.14), rgba(102,126,234,.08));
    border-color: rgba(148,163,184,.16);
}

.hero-kicker {
    letter-spacing: .12em;
    font-size: .78rem;
}

.hero-title {
    letter-spacing: -0.04em;
}

.hero-copy {
    max-width: 60ch;
    color: #5b6576;
}

body.tt-dark .hero-copy {
    color: #a1a8af;
}

.hero-stat-card {
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .08);
}

body.tt-dark .hero-stat-card {
    background: rgba(11,18,32,.9);
    border-color: #30363d;
}

.hero-stat-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6c757d;
    margin-bottom: .35rem;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: .35rem;
}

.hero-stat-subtitle {
    color: #5b6576;
}

body.tt-dark .hero-stat-subtitle,
body.tt-dark .hero-stat-label {
    color: #8b949e;
}

.tool-shell {
    border-radius: 1.25rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
}

body.tt-dark .tool-shell {
    background: rgba(11,18,32,.92);
}

.tool-tabs {
    padding: .25rem;
}

.tool-tabs .nav-link {
    border-radius: 999px;
    font-weight: 600;
    padding: .8rem 1rem;
    color: #4b5563;
    background: #eef2f7;
    border: 1px solid transparent;
}

.tool-tabs .nav-link:hover {
    color: #0d6efd;
    background: #e5eefc;
}

.tool-tabs .nav-link.active {
    background: linear-gradient(135deg, #0d6efd, #4c7ff7);
    color: #fff;
    box-shadow: 0 .5rem 1rem rgba(13,110,253,.22);
}

body.tt-dark .tool-tabs .nav-link {
    background: #111827;
    color: #c9d1d9;
    border-color: #30363d;
}

body.tt-dark .tool-tabs .nav-link:hover {
    background: #1f2937;
    color: #fff;
}

.tool-tabs .nav-item {
    flex: 1 1 auto;
}

.tools-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tool-card {
    border-radius: 1.25rem;
    overflow: hidden;
}

.tool-title {
    letter-spacing: -0.03em;
    margin: 0;
}

body.tt-dark .tool-title {
    color: #0969da;
}

.tool-actions .btn {
    border-radius: .85rem;
    padding: .65rem 1rem;
    font-weight: 600;
}

.tool-input {
    border-radius: 1rem;
    border: 1px solid #dbe3ee;
    padding: 1rem 1.05rem;
    min-height: 160px;
    box-shadow: inset 0 1px 2px rgba(15,23,42,.02);
}

.tool-input:focus {
    border-color: rgba(13,110,253,.55);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.12);
}

body.tt-dark .tool-input {
    background: #0b1220;
    color: #c9d1d9;
    border-color: #30363d;
}

body.tt-dark textarea.form-control.tool-input::placeholder {
    color: #ffffff;
}

body.tt-dark .tool-input::placeholder,
body.tt-dark .tool-input::-webkit-input-placeholder,
body.tt-dark .tool-input::-moz-placeholder,
body.tt-dark .tool-input:-ms-input-placeholder,
body.tt-dark .tool-input::-ms-input-placeholder {
    color: #ffffff;
    opacity: 0.85;
}

body.tt-dark .tool-input:focus {
    border-color: rgba(77,145,255,.65);
    box-shadow: 0 0 0 .2rem rgba(77,145,255,.15);
}

.output{
    background:#f8fafc;
    padding: 1rem;
    min-height:50px;
    border-radius: 1rem;
    white-space:pre-wrap;
    border: 1px solid #e5e7eb;
}

body.tt-dark .output{
    background:#0b1220;
    color:#c9d1d9;
    border-color:#30363d;
}

/* Unified Counter Metrics */
.counter-metrics {
  margin-bottom: 1.5rem;
}

.metric-box {
    background: linear-gradient(180deg, #ffffff, #f6f8fb);
    border: 1px solid #dbe3ee;
    border-radius: 1rem;
    padding: 12px;
  text-align: center;
    box-shadow: 0 .5rem 1.25rem rgba(15,23,42,.04);
}

body.tt-dark .metric-box {
  background: #0b1220;
  border-color: #30363d;
}

.metric-label {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 8px;
    font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.tt-dark .metric-label {
  color: #8b949e;
}

.metric-value {
    font-size: 1.55rem;
  font-weight: bold;
    background: linear-gradient(135deg, #0d6efd, #4c7ff7);
  color: white;
  padding: 12px 8px;
    border-radius: .85rem;
}

body.tt-dark .metric-value {
  background: #0969da;
}

.ad-slot {
    border: 1px dashed #c4ccd7;
    border-radius: 1rem;
    padding: 1rem 1.1rem;
  text-align: center;
    background: linear-gradient(180deg, #fff, #f8fafc);
    color: #495057;
}

body.tt-dark .ad-slot {
  background: #0b1220;
  border-color: #3a434d;
  color: #c9d1d9;
}

.ad-slot-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-bottom: 8px;
}

body.tt-dark .ad-slot-label {
  color: #8b949e;
}

.ad-slot-body {
    font-size: .98rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.ad-slot-meta {
  font-size: 0.85rem;
  color: #6c757d;
}

body.tt-dark .ad-slot-meta {
  color: #8b949e;
}

@media (max-width:576px){
  .nav-tabs { overflow:auto; white-space:nowrap; }
  .nav-tabs .nav-item { display:inline-block; }
  
    .hero-panel,
    .tool-shell,
    .tool-card {
        border-radius: 1rem;
    }

    .tool-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: .25rem;
    }

    .tool-tabs .nav-item {
        flex: 0 0 auto;
    }

    .tool-tabs .nav-link {
        white-space: nowrap;
    }

    .tool-input {
        min-height: 150px;
    }

  .metric-value {
    font-size: 1.25rem;
    padding: 10px 6px;
  }
}

@media (max-width: 991px) {
    .hero-stat-card {
        margin-top: .25rem;
    }

    .tool-actions .btn {
        flex: 1 1 auto;
    }
}

/* ========================
   COOKIE CONSENT BANNER
   ======================== */

.cookie-modal-shell {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.25);
}

body.tt-dark .cookie-modal-shell {
    background: #0b1220;
    color: #c9d1d9;
}

.cookie-modal-shell .modal-header,
.cookie-modal-shell .modal-footer {
    border-color: rgba(0, 0, 0, 0.08);
}

body.tt-dark .cookie-modal-shell .modal-header,
body.tt-dark .cookie-modal-shell .modal-footer {
    border-color: #30363d;
}

.cookie-modal-shell .modal-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.cookie-consent-root {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-consent-root.show {
    display: flex !important;
}

.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    pointer-events: auto;
}

.cookie-consent-overlay.show {
    display: block !important;
}

.cookie-consent-banner {
    position: relative;
    transform: none;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    z-index: 9999;
    display: none;
    border-top: 3px solid #667eea;
    max-height: 85vh;
    overflow-y: auto;
    max-width: 600px;
    width: 90%;
    border-radius: 12px;
    pointer-events: auto;
}

body.tt-dark .cookie-consent-banner {
    background: #0b1220;
    color: #c9d1d9;
    border-top-color: #667eea;
}

.cookie-consent-banner.show {
    display: block !important;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookie-banner-container {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.cookie-banner-header {
    margin-bottom: 20px;
}

.cookie-banner-header h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

body.tt-dark .cookie-banner-header h2 {
    color: #c9d1d9;
}

.cookie-banner-content {
    margin-bottom: 20px;
    text-align: left;
}

.cookie-banner-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

body.tt-dark .cookie-banner-content p {
    color: #a1a8af;
}

.cookie-category-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 13px;
    color: #555;
    border-left: 3px solid #667eea;
}

body.tt-dark .cookie-category-info {
    background: #1c2128;
    color: #a1a8af;
    border-left-color: #667eea;
}

.cookie-category-info strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

body.tt-dark .cookie-category-info strong {
    color: #c9d1d9;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cookie-banner-actions button {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-btn-accept {
    background: #28a745;
    color: white;
}

.cookie-btn-accept:hover {
    background: #218838;
}

.cookie-btn-reject {
    background: #dc3545;
    color: white;
}

.cookie-btn-reject:hover {
    background: #c82333;
}

.cookie-btn-customize {
    background: #667eea;
    color: white;
}

.cookie-btn-customize:hover {
    background: #764ba2;
}

.cookie-banner-footer {
    font-size: 12px;
    color: #999;
    text-align: center;
}

body.tt-dark .cookie-banner-footer {
    color: #8b949e;
}

.cookie-banner-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.cookie-banner-footer a:hover {
    text-decoration: underline;
}

.cookie-settings-link {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.tt-dark .cookie-settings-link {
    background: #1c2128;
    border-color: #30363d;
    color: #667eea;
}

.cookie-settings-link:hover {
    background: #dee2e6;
}

body.tt-dark .cookie-settings-link:hover {
    background: #30363d;
}

/* ========================
   CUSTOMIZE MODAL
   ======================== */

.cookie-customize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-customize-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

body.tt-dark .cookie-modal-content {
    background: #0b1220;
    color: #c9d1d9;
}

.cookie-modal-header {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

body.tt-dark .cookie-modal-header {
    color: #c9d1d9;
}

.cookie-modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.tt-dark .cookie-modal-close {
    color: #8b949e;
}

.cookie-modal-close:hover {
    color: #333;
}

body.tt-dark .cookie-modal-close:hover {
    color: #c9d1d9;
}

.cookie-category {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

body.tt-dark .cookie-category {
    border-bottom-color: #30363d;
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cookie-category-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

body.tt-dark .cookie-category-title {
    color: #c9d1d9;
}

.cookie-category-required {
    font-size: 11px;
    background: #e9ecef;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
}

body.tt-dark .cookie-category-required {
    background: #1c2128;
    color: #a1a8af;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #28a745;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #e9ecef;
    cursor: not-allowed;
}

body.tt-dark .cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #1c2128;
}

.cookie-category-description {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    line-height: 1.5;
}

body.tt-dark .cookie-category-description {
    color: #a1a8af;
}

.cookie-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.cookie-modal-actions button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cookie-modal-save {
    background: #667eea;
    color: white;
}

.cookie-modal-save:hover {
    background: #764ba2;
}

.cookie-modal-cancel {
    background: #e9ecef;
    color: #333;
}

body.tt-dark .cookie-modal-cancel {
    background: #1c2128;
    color: #c9d1d9;
}

.cookie-modal-cancel:hover {
    background: #dee2e6;
}

body.tt-dark .cookie-modal-cancel:hover {
    background: #30363d;
}

/* ========================
   CSV/JSON CONVERTER TOOL
   ======================== */

#csv-json-file {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

#csv-json-file:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.02);
}

body.tt-dark #csv-json-file {
    border-color: #30363d;
    background: transparent;
}

body.tt-dark #csv-json-file:hover {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.05);
}

/* JSON Format Selector */
#json-format-selector {
    background: rgba(13, 110, 253, 0.04);
    border: 1px solid rgba(13, 110, 253, 0.15);
    border-radius: 0.75rem;
    padding: 0.75rem;
}

body.tt-dark #json-format-selector {
    background: rgba(13, 110, 253, 0.08);
    border-color: rgba(88, 166, 255, 0.25);
}

/* Mode Selector Buttons */
#csv-json-convert {
    transition: all 0.2s ease;
}

#csv-json-download {
    transition: all 0.2s ease;
}

#csv-json-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#csv-json-download:not(:disabled) {
    background-color: #10b981;
    border-color: #10b981;
}

#csv-json-download:not(:disabled):hover {
    background-color: #059669;
    border-color: #059669;
}

body.tt-dark #csv-json-download:not(:disabled) {
    background-color: #238636;
    border-color: #238636;
}

body.tt-dark #csv-json-download:not(:disabled):hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

/* Error Display */
#csv-json-error {
    font-size: 0.95rem;
    border-radius: 0.75rem;
}

body.tt-dark #csv-json-error {
    background-color: rgba(220, 38, 38, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* File Name Display */
#csv-json-filename {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

body.tt-dark #csv-json-filename {
    color: #8b949e;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-banner-actions button {
        width: 100%;
    }

    .cookie-modal-actions {
        flex-direction: column;
    }

    .cookie-modal-actions button {
        width: 100%;
    }
}
