/* ============================================================
   CASE CONVERTER - Complete Stylesheet
   Scoped under .cc-app to avoid host page CSS conflicts
   ============================================================ */

.cc-app {
    /* Theme variables */
    --cc-bg-primary: #0f1117;
    --cc-bg-secondary: #161822;
    --cc-bg-tertiary: #1c1e2e;
    --cc-bg-card: #1e2032;
    --cc-bg-hover: #252840;
    --cc-bg-input: #12141f;
    --cc-border: #2a2d42;
    --cc-border-light: #353856;
    --cc-text-primary: #e8e9f0;
    --cc-text-secondary: #a0a3b8;
    --cc-text-muted: #6b6e85;
    --cc-accent: #6366f1;
    --cc-accent-light: #818cf8;
    --cc-accent-glow: rgba(99, 102, 241, 0.3);
    --cc-success: #22c55e;
    --cc-success-bg: rgba(34, 197, 94, 0.12);
    --cc-success-border: rgba(34, 197, 94, 0.3);
    --cc-danger: #ef4444;
    --cc-danger-bg: rgba(239, 68, 68, 0.12);
    --cc-warning: #f59e0b;
    --cc-warning-bg: rgba(245, 158, 11, 0.12);
    --cc-warning-border: rgba(245, 158, 11, 0.3);
    --cc-radius: 10px;
    --cc-radius-sm: 6px;
    --cc-radius-lg: 14px;
    --cc-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --cc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --cc-font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

    /* Self-contained full-screen layout */
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;

    /* Reset inherited styles */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cc-text-primary);
    background: var(--cc-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: left;
    direction: ltr;
    z-index: 1;
}

.cc-app *,
.cc-app *::before,
.cc-app *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cc-app button {
    font-family: inherit;
    cursor: pointer;
}

.cc-app input,
.cc-app select,
.cc-app textarea {
    font-family: inherit;
}

.cc-app a {
    color: var(--cc-accent-light);
    text-decoration: none;
}

/* ---------- App Layout ---------- */
.cc-app {
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
.cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--cc-bg-secondary);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    z-index: 10;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
}

.cc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-logo-icon {
    color: var(--cc-accent-light);
    flex-shrink: 0;
}

.cc-header-left h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--cc-accent-light);
    line-height: 1.2;
}

.cc-header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cc-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--cc-accent-glow);
    color: var(--cc-accent-light);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}

.cc-badge.cc-badge-outline {
    background: transparent;
    border: 1px solid var(--cc-border-light);
    color: var(--cc-text-secondary);
}

/* ---------- Toolbar ---------- */
.cc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--cc-bg-tertiary);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 48px;
}

.cc-toolbar-left,
.cc-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cc-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.cc-toolbar-hint {
    font-size: 12px;
    color: var(--cc-text-muted);
    line-height: 1.4;
}

/* Switch */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cc-bg-input);
    border: 1px solid var(--cc-border);
    border-radius: 100px;
    transition: all var(--cc-transition);
}

.cc-switch-slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--cc-text-secondary);
    border-radius: 50%;
    transition: all var(--cc-transition);
}

.cc-switch input:checked + .cc-switch-slider {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
}

.cc-switch input:checked + .cc-switch-slider::before {
    transform: translateX(16px);
    background: #ffffff;
}

.cc-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--cc-bg-input);
    border: 1px solid var(--cc-border);
    color: var(--cc-text-secondary);
    border-radius: var(--cc-radius-sm);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--cc-transition);
    line-height: 1.3;
}

.cc-toolbar-btn:hover {
    background: var(--cc-bg-hover);
    border-color: var(--cc-border-light);
    color: var(--cc-text-primary);
}

/* ---------- Main ---------- */
.cc-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* ---------- Input Section ---------- */
.cc-input-section {
    width: 380px;
    min-width: 380px;
    max-width: 380px;
    background: var(--cc-bg-secondary);
    border-right: 1px solid var(--cc-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}

.cc-input-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.cc-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    gap: 10px;
}

.cc-input-header h2 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-secondary);
    line-height: 1.4;
}

.cc-input-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cc-mini-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: var(--cc-bg-tertiary);
    border: 1px solid var(--cc-border);
    color: var(--cc-text-secondary);
    border-radius: var(--cc-radius-sm);
    font-size: 11px;
    font-weight: 500;
    transition: all var(--cc-transition);
    line-height: 1.3;
    cursor: pointer;
}

.cc-mini-btn:hover {
    background: var(--cc-bg-hover);
    border-color: var(--cc-border-light);
    color: var(--cc-text-primary);
}

.cc-mini-btn.cc-mini-copy,
.cc-mini-btn.cc-mini-use {
    padding: 5px;
}

.cc-detected-format {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--cc-bg-tertiary);
    border-bottom: 1px solid var(--cc-border);
    font-size: 11px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cc-format-label {
    color: var(--cc-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-format-tag {
    background: var(--cc-accent-glow);
    color: var(--cc-accent-light);
    padding: 2px 10px;
    border-radius: 100px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.cc-format-tag.cc-format-kebab { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
.cc-format-tag.cc-format-snake { background: rgba(34, 197, 94, 0.18); color: #22c55e; }
.cc-format-tag.cc-format-camel { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.cc-format-tag.cc-format-pascal { background: rgba(168, 85, 247, 0.18); color: #a855f7; }
.cc-format-tag.cc-format-screaming { background: rgba(239, 68, 68, 0.18); color: #ef4444; }
.cc-format-tag.cc-format-dot { background: rgba(6, 182, 212, 0.18); color: #06b6d4; }
.cc-format-tag.cc-format-constant { background: rgba(236, 72, 153, 0.18); color: #ec4899; }
.cc-format-tag.cc-format-title { background: rgba(20, 184, 166, 0.18); color: #14b8a6; }
.cc-format-tag.cc-format-sentence { background: rgba(132, 204, 22, 0.18); color: #84cc16; }
.cc-format-tag.cc-format-upper { background: rgba(249, 115, 22, 0.18); color: #f97316; }
.cc-format-tag.cc-format-lower { background: rgba(107, 114, 128, 0.18); color: #9ca3af; }
.cc-format-tag.cc-format-mixed { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.cc-format-tag.cc-format-empty { background: var(--cc-bg-card); color: var(--cc-text-muted); }

.cc-format-meta {
    color: var(--cc-text-muted);
    margin-left: auto;
    line-height: 1.3;
    white-space: nowrap;
}

.cc-input-textarea {
    flex: 1;
    width: 100%;
    background: var(--cc-bg-input);
    border: none;
    color: var(--cc-text-primary);
    padding: 16px 20px;
    font-size: 14px;
    font-family: var(--cc-font-mono);
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 200px;
}

.cc-input-textarea::placeholder {
    color: var(--cc-text-muted);
    font-style: italic;
    font-family: 'Segoe UI', system-ui, sans-serif;
    white-space: pre-wrap;
}

.cc-samples {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-top: 1px solid var(--cc-border);
    background: var(--cc-bg-tertiary);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cc-samples-label {
    font-size: 11px;
    color: var(--cc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.4;
    margin-right: 4px;
}

.cc-sample-btn {
    padding: 4px 10px;
    background: var(--cc-bg-input);
    border: 1px solid var(--cc-border);
    color: var(--cc-text-secondary);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    transition: all var(--cc-transition);
    line-height: 1.3;
    cursor: pointer;
}

.cc-sample-btn:hover {
    background: var(--cc-bg-hover);
    border-color: var(--cc-accent);
    color: var(--cc-accent-light);
}

/* ---------- Output Section ---------- */
.cc-output-section {
    flex: 1;
    overflow: auto;
    background: var(--cc-bg-primary);
    min-width: 0;
    height: 100%;
}

.cc-output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 16px 20px;
}

.cc-output-card {
    background: var(--cc-bg-card);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--cc-transition);
}

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

.cc-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--cc-bg-tertiary);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
    gap: 8px;
}

.cc-output-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.cc-case-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-text-primary);
    line-height: 1.3;
}

.cc-case-desc {
    font-size: 10px;
    color: var(--cc-text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--cc-font-mono);
}

.cc-output-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.cc-output-content {
    flex: 1;
    min-height: 100px;
}

.cc-output-textarea {
    width: 100%;
    background: var(--cc-bg-input);
    border: none;
    color: var(--cc-accent-light);
    padding: 12px;
    font-size: 13px;
    font-family: var(--cc-font-mono);
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 100px;
}

.cc-output-textarea:focus {
    background: var(--cc-bg-input);
}

.cc-output-textarea::placeholder {
    color: var(--cc-text-muted);
    font-style: italic;
}

/* ---------- Toast ---------- */
.cc-toast-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.cc-toast {
    background: var(--cc-bg-card);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    padding: 12px 20px;
    font-size: 13px;
    color: var(--cc-text-primary);
    box-shadow: var(--cc-shadow);
    animation: cc-toast-in 0.3s ease, cc-toast-out 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 380px;
    line-height: 1.4;
    pointer-events: auto;
}

.cc-toast.cc-success {
    border-color: rgba(34, 197, 94, 0.4);
}

.cc-toast.cc-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.cc-toast.cc-warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.cc-toast.cc-info {
    border-color: rgba(99, 102, 241, 0.4);
}

.cc-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

@keyframes cc-toast-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cc-toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* ---------- Scrollbar ---------- */
.cc-app ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.cc-app ::-webkit-scrollbar-track {
    background: transparent;
}

.cc-app ::-webkit-scrollbar-thumb {
    background: var(--cc-border-light);
    border-radius: 100px;
}

.cc-app ::-webkit-scrollbar-thumb:hover {
    background: var(--cc-text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .cc-input-section {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        max-height: 50%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--cc-border);
    }

    .cc-main {
        flex-direction: column;
    }

    .cc-output-grid {
        grid-template-columns: 1fr;
    }
}
