* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

#languageSelect {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#languageSelect:hover {
    border-color: #667eea;
}

#languageSelect:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.permission-matrix {
    display: grid;
    grid-template-columns: 100px repeat(3, 1fr);
    gap: 15px;
    align-items: center;
}

.permission-header {
    display: contents;
    font-weight: 600;
    color: #4a5568;
}

.permission-header > div:first-child {
    visibility: hidden;
}

.permission-row {
    display: contents;
}

.permission-label {
    font-weight: 500;
    color: #4a5568;
}

.checkbox-wrapper {
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 40px;
    height: 40px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-custom::after {
    content: '✓';
    font-size: 20px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.input-group {
    margin-bottom: 20px;
}

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

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.results-card {
    grid-column: span 2;
}

.result-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.result-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 150px;
}

.result-value {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 600;
}

.command-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.command-display code {
    flex: 1;
    padding: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.copy-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.preset-btn {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.preset-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.preset-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #2d3748;
}

.preset-desc {
    font-size: 0.85rem;
    color: #718096;
    text-align: center;
}

.explanation-card {
    grid-column: span 2;
}

.explanation-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.explanation-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.explanation-section ul {
    list-style: none;
}

.explanation-section li {
    padding: 8px 0;
    color: #4a5568;
    position: relative;
    padding-left: 25px;
}

.explanation-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.explanation-section strong {
    color: #2d3748;
}

footer {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin-top: 40px;
    color: #718096;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .results-card,
    .explanation-card {
        grid-column: span 1;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
    
    .permission-matrix {
        grid-template-columns: 80px repeat(3, 1fr);
        gap: 10px;
    }
    
    .checkbox-custom {
        width: 35px;
        height: 35px;
    }
    
    .command-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-btn {
        width: 100%;
    }
}