:root {
    --primary-color: #4CAF50;
    --primary-hover: #3d8b40;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-color: #333333;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --disabled-bg: #f5f5f5;
    --bg-gradient-start: #f8fff8;
    --bg-gradient-end: #e8f5e9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Panel Layout */
.left-panel {
    flex: 1;
    min-width: 300px;
}

.right-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Styles */
.tool-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.card-title {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.card-title i {
    margin-right: 12px;
    font-size: 1.5rem;
}

/* Button Styles */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    font-size: 15px;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(76, 175, 80, 0.08);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

/* Form Elements */
textarea, .code-output {
    width: 100%;
    min-height: 250px;
    padding: 18px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 20px;
    background: #fcfcfc;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.form-select {
    padding: 10px 15px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: white;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

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

/* Panels */
.error-panel {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-panel {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Code Output */
.code-output {
    background: #2d2d2d;
    color: #f8f8f2;
    overflow: auto;
    white-space: pre;
    line-height: 1.5;
    position: relative;
}

.code-output .key { color: #ff79c6; }
.code-output .value { color: #50fa7b; }
.code-output .comment { color: #6272a4; font-style: italic; }
.code-output .number { color: #bd93f9; }
.code-output .boolean { color: #f1fa8c; }

/* Info Panels */
.conversion-info {
    background: rgba(74, 144, 226, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.conversion-info h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversion-info ul {
    padding-left: 20px;
}

.conversion-info li {
    margin-bottom: 8px;
}

/* File Upload */
.file-upload-label {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-upload-label input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* JSON Tools Specific Styles */
.form-group {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* YAML Tools Specific Styles */
.yaml-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.yaml-panel h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.yaml-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-width: 120px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* QR Code Tools Specific Styles */
.input-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.input-tab-content {
    display: none;
}

.input-tab-content.active {
    display: block;
}

.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px 0;
}

#qrcode {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-overlay img {
    display: block;
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
}

.logo-upload-area {
    margin: 20px 0;
    text-align: center;
}

.logo-preview {
    width: 120px;
    height: 120px;
    margin: 15px auto;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
}

.input-container {
    position: relative;
    margin-bottom: 20px;
}

.input-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
}

.text-indicator {
    color: #4CAF50;
}

.json-indicator {
    color: #2196F3;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
}

.slider-container {
    display: flex;
    flex-direction: column;
    margin: 15px 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.qr-buttons-spacer {
    height: 25px;
}

/* Encryption Tools Specific Styles */
.encryption-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.option-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.option-group h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Learning Tools Specific Styles */
.learning-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.exercise-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exercise-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.exercise-card.active {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.exercise-content {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.code-editor {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fcfcfc;
}

/* Vocabulary Memory Tools Specific Styles */
.vocab-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.vocab-card:hover {
    transform: translateY(-5px);
}

.vocab-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.vocab-phonetic {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.vocab-definition {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    max-width: 600px;
}

.vocab-example {
    font-style: italic;
    color: #666;
    margin-top: 15px;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Data Analysis Tools Specific Styles */
.chart-container {
    height: 400px;
    margin: 20px 0;
}

.filter-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Navigation */
.navigation {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 30px;
}

.navigation h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.nav-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.nav-item i {
    font-size: 1.2rem;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #5BA3F7;
        --primary-hover: #4A88D1;
        --card-bg: #2D3748;
        --border-color: #4A5568;
        --text-color: #E2E8F0;
        --bg-gradient-start: #1A202C;
        --bg-gradient-end: #2D3748;
    }
    
    body {
        background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
        color: var(--text-color);
    }
    
    textarea, .code-editor {
        background: #1A202C;
        color: var(--text-color);
        border-color: var(--border-color);
    }
    
    .code-output {
        background: #1A202C;
        color: #E2E8F0;
    }
    
    .yaml-panel, .encryption-options .option-group, .learning-panel, .filter-panel {
        background: #1A202C;
        border-color: var(--border-color);
    }
    
    .exercise-card, .vocab-card {
        background: #1A202C;
        border-color: var(--border-color);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn, .form-select {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        text-align: left;
    }
    
    .color-controls, .encryption-options, .navigation .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .vocab-card {
        padding: 20px;
        min-height: 200px;
    }
    
    .vocab-word {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.7rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    textarea, .code-output, .code-editor {
        min-height: 200px;
        font-size: 13px;
    }
}