/* Developer Toolkit Pro - 공통 스타일 상속 */

/* ==================== Base Styles ==================== */
* {
    box-sizing: border-box;
}

/* Main Container */
.dt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp6, 32px) var(--sp4, 16px);
}

.dt-container h1 {
    text-align: center;
    font-size: var(--fs-h1, 2.5rem);
    font-weight: 700;
    color: var(--g900, #18181b);
    margin-bottom: var(--sp6, 32px);
}

section h2 {
    font-size: var(--fs-h2, 1.4rem);
    font-weight: 600;
    color: var(--g900, #18181b);
    margin-bottom: var(--sp4, 16px);
}

section h3 {
    font-size: var(--fs-h3, 1.2rem);
    font-weight: 600;
    color: var(--g900, #18181b);
    margin-bottom: var(--sp3, 12px);
}

/* ==================== Cards ==================== */
.card {
    background: var(--glass-bg, rgba(255,255,255,0.7));
    backdrop-filter: blur(var(--blur, 20px));
    border-radius: var(--radius-card, 1.2rem);
    padding: var(--sp5, 24px);
    margin-bottom: var(--sp5, 24px);
    box-shadow: var(--shadow, 0 4px 32px rgba(0,0,0,0.06));
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover, 0 8px 40px rgba(0,0,0,0.12));
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: var(--sp4, 16px);
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: var(--sp4, 16px);
}

.form-group label {
    display: block;
    margin-bottom: var(--sp2, 8px);
    color: var(--g700, #374151);
    font-weight: 600;
    font-size: 0.95rem;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: var(--sp3, 12px) var(--sp4, 16px);
    border: 2px solid var(--g200, #e5e7eb);
    border-radius: var(--radius-btn, 8px);
    font-family: Pretendard, system-ui, sans-serif;
    font-size: 1rem;
    color: var(--g900, #18181b);
    background: white;
    transition: all 0.2s ease;
}

.textarea {
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== Buttons ==================== */
.btn {
    padding: var(--sp3, 12px) var(--sp4, 16px);
    border: none;
    border-radius: var(--radius-btn, 8px);
    font-family: Pretendard, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--sp2, 8px);
}

.btn-primary {
    background: var(--brand, #6366f1);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-hov, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--g200, #e5e7eb);
    color: var(--g700, #374151);
}

.btn-secondary:hover {
    background: var(--g300, #d4d4d8);
}

.btn-sm {
    padding: var(--sp2, 8px) var(--sp3, 12px);
    font-size: 0.875rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp3, 12px);
    margin-top: var(--sp4, 16px);
}

/* ==================== Slider ==================== */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--g200, #e5e7eb);
    outline: none;
    -webkit-appearance: none;
    margin: var(--sp3, 12px) 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand, #6366f1);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand, #6366f1);
    cursor: pointer;
    border: none;
}

/* ==================== Checkbox ==================== */
.checkbox {
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp4, 16px);
    margin: var(--sp5, 24px) 0;
}

.stat-card {
    background: var(--g100, #f3f4f6);
    padding: var(--sp4, 16px);
    border-radius: var(--radius-btn, 8px);
    text-align: center;
}

.stat-label {
    color: var(--g500, #6b7280);
    font-size: 0.9rem;
    margin-bottom: var(--sp2, 8px);
}

.stat-value {
    color: var(--brand, #6366f1);
    font-size: 1.8rem;
    font-weight: 700;
}

/* ==================== Grid Layouts ==================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--sp4, 16px);
}

/* ==================== Toggle Switch ==================== */
.toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 27px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--g300, #d4d4d8);
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-thumb {
    position: absolute;
    height: 19px;
    width: 19px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-track {
    background-color: var(--brand, #6366f1);
}

.toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(24px);
}

/* ==================== Utility Classes ==================== */
.flex {
    display: flex;
}

.items-c {
    align-items: center;
}

.justify-b {
    justify-content: space-between;
}

.help-text {
    color: var(--g600, #52525b);
    font-size: 0.9rem;
    margin-bottom: var(--sp3, 12px);
}

/* Tab Navigation */
.tabs-nav {
    display: flex;
    gap: var(--sp2, 8px);
    margin-bottom: var(--sp5, 24px);
    border-bottom: 2px solid var(--g200, #e5e7eb);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
    padding: var(--sp3, 12px) var(--sp4, 16px);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--g700, #71717a);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--brand, #6366f1);
    background: var(--g100, #f3f4f6);
}

.tab-btn.active {
    color: var(--brand, #6366f1);
    border-bottom-color: var(--brand, #6366f1);
}

.tab-btn i {
    font-size: 1.25rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Code Editor */
.code-editor {
    width: 100%;
    min-height: 200px;
    padding: var(--sp4, 16px);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--g900, #18181b);
    color: #e4e4e7;
    border: 1px solid var(--g300, #d4d4d8);
    border-radius: var(--radius-btn, 8px);
    resize: vertical;
    tab-size: 2;
}

[data-theme="dark"] .code-editor {
    background: #09090b;
    border-color: var(--g700, #71717a);
}

.code-editor::placeholder {
    color: #71717a;
}

/* Preview Frame */
.preview-frame {
    width: 100%;
    height: 500px;
    border: 1px solid var(--g300, #d4d4d8);
    border-radius: var(--radius-btn, 8px);
    background: white;
}

.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp3, 12px);
}

/* Resource Results */
.resource-list {
    margin-top: var(--sp4, 16px);
}

.resource-item {
    padding: var(--sp3, 12px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    margin-bottom: var(--sp2, 8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.resource-type.image {
    background: #dbeafe;
    color: #1e40af;
}

.resource-type.script {
    background: #fef3c7;
    color: #92400e;
}

.resource-type.stylesheet {
    background: #ddd6fe;
    color: #5b21b6;
}

.resource-type.link {
    background: #d1fae5;
    color: #065f46;
}

/* URL Inspector */
.url-part {
    padding: var(--sp3, 12px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    margin-bottom: var(--sp2, 8px);
}

.url-part .label {
    font-weight: 600;
    color: var(--g700, #71717a);
    margin-right: var(--sp2, 8px);
}

.url-part code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--brand, #6366f1);
}

.params-table {
    margin-top: var(--sp2, 8px);
    display: grid;
    gap: var(--sp2, 8px);
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--sp2, 8px);
    padding: var(--sp2, 8px);
    background: white;
    border-radius: 4px;
}

/* SEO Checklist */
.seo-checklist {
    display: grid;
    gap: var(--sp2, 8px);
}

.seo-item {
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
    padding: var(--sp3, 12px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    border-left: 4px solid transparent;
}

.seo-item.pass {
    border-left-color: #10b981;
}

.seo-item.fail {
    border-left-color: #ef4444;
}

.seo-item.warn {
    border-left-color: #f59e0b;
}

.seo-item i {
    font-size: 1.5rem;
}

.seo-item.pass i {
    color: #10b981;
}

.seo-item.fail i {
    color: #ef4444;
}

.seo-item.warn i {
    color: #f59e0b;
}

/* Password Display */
.password-display {
    display: flex;
    gap: var(--sp2, 8px);
    align-items: center;
    padding: var(--sp4, 16px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    margin: var(--sp3, 12px) 0;
}

.password-display code {
    flex: 1;
    padding: var(--sp3, 12px);
    background: white;
    border-radius: var(--radius-btn, 8px);
    font-size: 1.125rem;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--brand, #6366f1);
    word-break: break-all;
}

.password-strength {
    margin-top: var(--sp2, 8px);
    font-weight: 600;
}

/* Strength Meter */
.strength-meter {
    height: 8px;
    background: var(--g200, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
    margin: var(--sp3, 12px) 0;
}

.strength-bar {
    height: 100%;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-bar.strong {
    width: 100%;
    background: #10b981;
}

.strength-info {
    margin: var(--sp3, 12px) 0;
}

/* Checklist */
.checklist {
    display: grid;
    gap: var(--sp2, 8px);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
    padding: var(--sp2, 8px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
}

.checklist-item i {
    font-size: 1.25rem;
}

.checklist-item.pass i {
    color: #10b981;
}

.checklist-item.fail i {
    color: #ef4444;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    gap: var(--sp2, 8px);
    margin: var(--sp3, 12px) 0;
}

/* Hash Results */
.hash-result {
    display: flex;
    align-items: center;
    gap: var(--sp2, 8px);
    padding: var(--sp3, 12px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    margin-bottom: var(--sp2, 8px);
}

.hash-label {
    font-weight: 600;
    min-width: 80px;
    color: var(--g700, #71717a);
}

.hash-result code {
    flex: 1;
    padding: var(--sp2, 8px);
    background: white;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    word-break: break-all;
    color: var(--brand, #6366f1);
}

/* Validation Message */
.validation-message {
    padding: var(--sp3, 12px);
    border-radius: var(--radius-btn, 8px);
    margin: var(--sp3, 12px) 0;
    display: none;
}

.validation-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.validation-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Regex Input */
.regex-input {
    display: flex;
    gap: var(--sp2, 8px);
}

.regex-input input {
    flex: 1;
}

.regex-flags {
    display: flex;
    gap: var(--sp2, 8px);
}

.regex-flags .checkbox {
    margin: 0;
}

.regex-flags .checkbox span {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

/* Match List */
.match-list {
    margin-top: var(--sp3, 12px);
}

.match-item {
    padding: var(--sp3, 12px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
    margin-bottom: var(--sp2, 8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-text {
    font-family: 'Consolas', 'Monaco', monospace;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--brand, #6366f1);
}

.match-position {
    font-size: 0.875rem;
    color: var(--g700, #71717a);
}

/* Check Grid */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--sp4, 16px);
}

.check-item {
    padding: var(--sp4, 16px);
    background: var(--g100, #f3f4f6);
    border-radius: var(--radius-btn, 8px);
}

.check-item h3 {
    margin-bottom: var(--sp3, 12px);
    font-size: 1rem;
    color: var(--g900, #18181b);
}

.check-item input {
    margin-bottom: var(--sp2, 8px);
}

.check-result {
    margin-top: var(--sp2, 8px);
    padding: var(--sp2, 8px);
    border-radius: 4px;
    font-weight: 500;
    display: none;
}

.check-result.valid {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.check-result.invalid {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* Input Group Inline */
.input-group-inline {
    display: flex;
    gap: var(--sp2, 8px);
}

.input-group-inline input {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dt-container {
        padding: var(--sp4, 16px) var(--sp3, 12px);
    }

    .tabs-nav {
        gap: var(--sp1, 4px);
    }

    .tab-btn {
        padding: var(--sp2, 8px) var(--sp3, 12px);
        font-size: 0.875rem;
    }

    .tab-btn span {
        display: none;
    }

    .tab-btn i {
        font-size: 1.5rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .code-editor {
        min-height: 150px;
        font-size: 0.75rem;
    }

    .preview-frame {
        height: 300px;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }

    .regex-input {
        flex-direction: column;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .resource-item,
[data-theme="dark"] .url-part,
[data-theme="dark"] .seo-item,
[data-theme="dark"] .password-display,
[data-theme="dark"] .hash-result,
[data-theme="dark"] .match-item,
[data-theme="dark"] .check-item,
[data-theme="dark"] .checklist-item {
    background: var(--g800, #27272a);
}

[data-theme="dark"] .url-part code,
[data-theme="dark"] .password-display code,
[data-theme="dark"] .hash-result code,
[data-theme="dark"] .match-text {
    background: var(--g900, #18181b);
}

[data-theme="dark"] .param-row {
    background: var(--g900, #18181b);
}

[data-theme="dark"] .preview-frame {
    border-color: var(--g700, #71717a);
}
