/* ═══════════════════════════════════════════════════════
   CASE CONVERTER TOOL – Enhanced & Classy Stylesheet
   OnlineNotes.io
   ═══════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS & VARIABLES ───────────────────────── */
:root {
    --cc-bg: var(--surface-2);
    --cc-card-bg: var(--surface);
    --cc-card-border: rgba(68, 97, 242, 0.18);
    --cc-card-border-hover: rgba(68, 97, 242, 0.35);
    --cc-card-shadow: 0 4px 20px -2px rgba(68, 97, 242, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
    --cc-card-shadow-hover: 0 8px 30px -4px rgba(68, 97, 242, 0.14), 0 4px 10px rgba(0, 0, 0, 0.04);

    --cc-text-main: var(--ink);
    --cc-text-sub: var(--ink-2);
    --cc-text-muted: var(--ink-3);

    --cc-surface-2: var(--surface-2);
    --cc-surface-3: var(--surface-3);
    --cc-header-bg: rgba(68, 97, 242, 0.03);
    --cc-divider: rgba(68, 97, 242, 0.08);

    --cc-btn-bg: var(--surface);
    --cc-btn-color: var(--ink-2);
    --cc-btn-border: rgba(68, 97, 242, 0.14);
    --cc-btn-hover-bg: var(--indigo-light);
    --cc-btn-hover-border: rgba(68, 97, 242, 0.35);
    --cc-btn-hover-color: var(--indigo);

    --cc-primary: #4461f2;
    --cc-primary-light: rgba(68, 97, 242, 0.1);
    --cc-green: #10b981;
    --cc-green-bg: rgba(16, 185, 129, 0.1);
    --cc-rose: #f43f5e;
    --cc-rose-bg: rgba(244, 63, 94, 0.08);

    --cc-radius: 16px;
    --cc-radius-sm: 9px;
    --cc-radius-xs: 6px;
    --cc-transition: 0.2s ease;
}

[data-theme="dark"] {
    --cc-bg: #0f1218;
    --cc-card-bg: #171a23;
    --cc-card-border: rgba(99, 102, 241, 0.24);
    --cc-card-border-hover: rgba(129, 140, 248, 0.45);
    --cc-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
    --cc-card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5);

    --cc-text-main: #f8fafc;
    --cc-text-sub: #cbd5e1;
    --cc-text-muted: #94a3b8;

    --cc-surface-2: #12151e;
    --cc-surface-3: #1f2330;
    --cc-header-bg: rgba(30, 35, 48, 0.6);
    --cc-divider: rgba(255, 255, 255, 0.07);

    --cc-btn-bg: #1c202d;
    --cc-btn-color: #cbd5e1;
    --cc-btn-border: rgba(255, 255, 255, 0.1);
    --cc-btn-hover-bg: rgba(68, 97, 242, 0.18);
    --cc-btn-hover-border: rgba(129, 140, 248, 0.4);
    --cc-btn-hover-color: #818cf8;

    --cc-primary-light: rgba(68, 97, 242, 0.2);
    --cc-green-bg: rgba(16, 185, 129, 0.18);
    --cc-rose-bg: rgba(244, 63, 94, 0.15);
}

/* ─── PAGE WRAPPER ────────────────────────────────────── */
.cc-page-wrapper {
    background: var(--cc-bg);
    min-height: calc(100vh - 80px);
    padding: 100px 0 80px;
    transition: background 0.3s ease;
}

/* ─── PAGE HEADER ─────────────────────────────────────── */
.cc-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 28px;
}

.cc-header h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--cc-text-main);
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 0;
}

.cc-header h1 span {
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── WORKSPACE LAYOUT ────────────────────────────────── */
.cc-workspace {
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 1040px;
    margin: 0 auto;
}

/* ─── PROMINENT CARD BASE ─────────────────────────────── */
.cc-card {
    background: var(--cc-card-bg);
    border: 1.5px solid var(--cc-card-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-card-shadow);
    overflow: hidden;
    transition: border-color var(--cc-transition), box-shadow var(--cc-transition), background 0.3s ease;
}

.cc-card:hover {
    border-color: var(--cc-card-border-hover);
    box-shadow: var(--cc-card-shadow-hover);
}

/* ═══ 1. INPUT EDITOR CARD ══════════════════════════════ */
.cc-input-card {
    display: flex;
    flex-direction: column;
}

/* Card Header & Toolbar */
.cc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--cc-header-bg);
    border-bottom: 1.5px solid var(--cc-divider);
    flex-wrap: wrap;
    gap: 12px;
}

.cc-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--cc-radius-sm);
    background: var(--indigo-light);
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .cc-card-icon {
    background: rgba(68, 97, 242, 0.2);
    color: #818cf8;
}

.cc-card-title h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0;
    letter-spacing: -0.01em;
}

.cc-title-dot {
    color: var(--cc-text-muted);
    font-weight: bold;
}

.cc-live-tag {
    font-size: 12.5px;
    color: var(--cc-text-muted);
    font-weight: 500;
    transition: color 0.25s, transform 0.25s;
}

.cc-live-tag.highlight {
    color: var(--indigo);
    font-weight: 700;
    transform: scale(1.03);
}

[data-theme="dark"] .cc-live-tag.highlight {
    color: #818cf8;
}

/* Toolbar Action Buttons */
.cc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--cc-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-btn-color);
    background: var(--cc-btn-bg);
    border: 1.5px solid var(--cc-btn-border);
    cursor: pointer;
    transition: all var(--cc-transition);
    white-space: nowrap;
    font-family: var(--font-body);
}

.cc-action-btn:hover:not(:disabled) {
    color: var(--cc-btn-hover-color);
    background: var(--cc-btn-hover-bg);
    border-color: var(--cc-btn-hover-border);
    transform: translateY(-1px);
}

.cc-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cc-action-btn:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

.cc-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--cc-divider);
}

/* Primary (Copy) action */
.cc-action-btn--primary {
    color: var(--indigo);
    border-color: rgba(68, 97, 242, 0.25);
    background: rgba(68, 97, 242, 0.05);
}

[data-theme="dark"] .cc-action-btn--primary {
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(68, 97, 242, 0.12);
}

.cc-action-btn--primary:hover:not(:disabled) {
    background: var(--indigo);
    color: #ffffff;
    border-color: var(--indigo);
    box-shadow: 0 3px 12px rgba(68, 97, 242, 0.3);
}

/* Success state (e.g. Copied!) */
.cc-action-btn--success {
    color: #ffffff !important;
    background: var(--cc-green) !important;
    border-color: var(--cc-green) !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3) !important;
}

/* Danger (Clear) action */
.cc-action-btn--danger {
    color: var(--cc-rose);
    border-color: rgba(244, 63, 94, 0.2);
}

.cc-action-btn--danger:hover:not(:disabled) {
    color: var(--cc-rose);
    background: var(--cc-rose-bg);
    border-color: rgba(244, 63, 94, 0.35);
}

/* Textarea */
.cc-textarea-section {
    padding: 0;
    position: relative;
}

.cc-textarea-wrap {
    position: relative;
    width: 100%;
}

#cc-input {
    width: 100%;
    min-height: 220px;
    max-height: 520px;
    padding: 20px 22px;
    font-size: 15.5px;
    font-family: var(--font-body);
    color: var(--cc-text-main);
    background: var(--cc-card-bg);
    border: none;
    outline: none;
    resize: none;
    line-height: 1.7;
    transition: background 0.3s ease;
    display: block;
    box-sizing: border-box;
}

#cc-input::placeholder {
    color: var(--cc-text-muted);
    opacity: 0.65;
}

#cc-input:focus {
    background: rgba(68, 97, 242, 0.015);
}

[data-theme="dark"] #cc-input:focus {
    background: rgba(68, 97, 242, 0.03);
}

/* Card Footer & Stats Bar */
.cc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    background: var(--cc-header-bg);
    border-top: 1.5px solid var(--cc-divider);
    flex-wrap: wrap;
    gap: 10px;
}

.cc-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cc-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--cc-text-muted);
    padding: 4px 11px;
    border-radius: 99px;
    background: var(--cc-card-bg);
    border: 1px solid var(--cc-btn-border);
    transition: all var(--cc-transition);
}

.cc-stat-item strong {
    font-weight: 700;
    color: var(--indigo);
}

[data-theme="dark"] .cc-stat-item strong {
    color: #818cf8;
}

.cc-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-green);
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--cc-green-bg);
}

.cc-privacy-badge svg {
    flex-shrink: 0;
}

/* ═══ 2. CHOOSE CONVERTER CARD ══════════════════════════ */
.cc-converter-card {
    display: flex;
    flex-direction: column;
}

.cc-converter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px;
    background: var(--cc-header-bg);
    border-bottom: 1.5px solid var(--cc-divider);
    flex-wrap: wrap;
    gap: 8px;
}

.cc-converter-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-conv-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: var(--cc-radius-sm);
    background: var(--indigo-light);
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .cc-conv-icon-wrap {
    background: rgba(68, 97, 242, 0.2);
    color: #818cf8;
}

.cc-converter-title h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0;
    letter-spacing: -0.01em;
}

.cc-conv-hint {
    font-size: 12.5px;
    color: var(--cc-text-muted);
    font-weight: 500;
}

/* Converter Groups */
.cc-converter-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cc-conv-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cc-conv-group-label {
    display: flex;
    align-items: center;
}

.cc-group-tag {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
    padding: 2px 8px;
    border-radius: var(--cc-radius-xs);
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-divider);
}

.cc-conv-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

/* Conversion Buttons */
.cc-conv-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: var(--cc-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cc-btn-color);
    background: var(--cc-btn-bg);
    border: 1.5px solid var(--cc-btn-border);
    cursor: pointer;
    transition: all var(--cc-transition);
    font-family: var(--font-body);
    white-space: nowrap;
    user-select: none;
}

.cc-conv-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--cc-transition), transform var(--cc-transition);
}

.cc-conv-btn:hover {
    color: var(--indigo);
    background: var(--indigo-light);
    border-color: rgba(68, 97, 242, 0.35);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(68, 97, 242, 0.12);
}

.cc-conv-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.cc-conv-btn:active {
    transform: translateY(0);
}

.cc-conv-btn:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

/* Active & Applied Animation */
.cc-conv-btn.active {
    color: #ffffff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(68, 97, 242, 0.35);
}

.cc-conv-btn.active svg {
    opacity: 1;
    color: #ffffff;
}

.cc-conv-btn.applied {
    animation: ccBtnPulse 0.35s ease-out;
}

@keyframes ccBtnPulse {
    0% {
        transform: scale(0.96);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

[data-theme="dark"] .cc-conv-btn {
    background: var(--cc-btn-bg);
    border-color: var(--cc-btn-border);
    color: var(--cc-btn-color);
}

[data-theme="dark"] .cc-conv-btn:hover {
    color: #818cf8;
    background: rgba(68, 97, 242, 0.18);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 16px rgba(68, 97, 242, 0.25);
}

[data-theme="dark"] .cc-conv-btn.active {
    color: #ffffff;
    background: var(--grad);
    border-color: transparent;
}

/* ─── EDUCATIONAL CONTENT SECTION ─────────────────────── */
.cc-content-section {
    margin-top: 48px;
    padding: 0 0 32px;
}

.cc-content-card {
    background: var(--cc-card-bg);
    border: 1.5px solid var(--cc-card-border);
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-card-shadow);
    padding: 32px 36px;
    margin-bottom: 24px;
    transition: border-color var(--cc-transition), box-shadow var(--cc-transition), background 0.3s ease;
}

.cc-content-card:hover {
    border-color: var(--cc-card-border-hover);
}

.cc-content-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.cc-content-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--indigo-light);
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .cc-content-card-icon {
    background: rgba(68, 97, 242, 0.2);
    color: #818cf8;
}

.cc-content-card h2 {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.3vw, 24px);
    font-weight: 700;
    color: var(--cc-text-main);
    line-height: 1.25;
    margin: 0;
}

.cc-content-card p {
    font-size: 15px;
    color: var(--cc-text-sub);
    line-height: 1.75;
    margin-bottom: 14px;
}

.cc-content-card p:last-child {
    margin-bottom: 0;
}

.cc-content-card strong {
    font-weight: 600;
    color: var(--cc-text-main);
}

/* Glossary Cases Grid */
.cc-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.cc-case-item {
    padding: 15px 17px;
    border-radius: var(--cc-radius-sm);
    border: 1px solid var(--cc-divider);
    background: var(--cc-surface-2);
    transition: all var(--cc-transition);
}

.cc-case-item:hover {
    border-color: rgba(68, 97, 242, 0.3);
    background: var(--indigo-light);
}

[data-theme="dark"] .cc-case-item:hover {
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(68, 97, 242, 0.12);
}

.cc-case-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--indigo);
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}

[data-theme="dark"] .cc-case-item-name {
    color: #818cf8;
}

.cc-case-item-desc {
    font-size: 13px;
    color: var(--cc-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Steps Grid */
.cc-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.cc-step {
    text-align: center;
    padding: 22px 18px;
    border-radius: var(--cc-radius-sm);
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-divider);
}

.cc-step-number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--grad);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(68, 97, 242, 0.3);
}

.cc-step h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0 0 6px;
}

.cc-step p {
    font-size: 13px;
    color: var(--cc-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Use Cases Grid */
.cc-use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.cc-use-case {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border-radius: var(--cc-radius-sm);
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-divider);
    transition: all var(--cc-transition);
}

.cc-use-case:hover {
    border-color: rgba(68, 97, 242, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(68, 97, 242, 0.08);
}

.cc-use-case-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--indigo-light);
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .cc-use-case-icon {
    background: rgba(68, 97, 242, 0.2);
    color: #818cf8;
}

.cc-use-case-text h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin-bottom: 3px;
}

.cc-use-case-text p {
    font-size: 12.5px;
    color: var(--cc-text-muted);
    line-height: 1.5;
    margin: 0;
}

.tool-card{
    background-color: white !important;
}

/* ─── TOAST NOTIFICATION ──────────────────────────────── */
.cc-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--cc-card-bg);
    border: 1.5px solid var(--cc-card-border);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cc-text-main);
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-width: 340px;
}

.cc-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cc-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-toast--success .cc-toast-icon {
    background: var(--cc-green-bg);
    color: var(--cc-green);
}

.cc-toast--error .cc-toast-icon {
    background: var(--cc-rose-bg);
    color: var(--cc-rose);
}

/* ─── RESPONSIVE STYLING ──────────────────────────────── */
@media (max-width: 768px) {
    .cc-page-wrapper {
        padding: 90px 0 60px;
    }

    .cc-card-header {
        padding: 12px 16px;
    }

    .cc-card-footer {
        padding: 10px 16px;
    }

    .cc-converter-header {
        padding: 12px 16px;
    }

    .cc-converter-body {
        padding: 16px;
        gap: 16px;
    }

    .cc-content-card {
        padding: 24px 20px;
    }

    #cc-input {
        min-height: 180px;
        padding: 16px;
        font-size: 14.5px;
    }
}

@media (max-width: 600px) {
    .cc-header h1 {
        font-size: clamp(24px, 6.5vw, 34px);
    }

    .cc-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cc-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .cc-action-btn {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .cc-conv-btns {
        gap: 6px;
    }

    .cc-conv-btn {
        font-size: 12.5px;
        padding: 7px 11px;
    }

    .cc-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cc-stats-bar {
        gap: 5px;
    }

    .cc-stat-item {
        font-size: 11.5px;
        padding: 3px 8px;
    }

    .cc-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 576px) {
    .cc-btn-label {
        display: none !important;
    }
}