/* ChmodCalc Styles */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #252542;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #334155;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Main Tool */
.tool {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: 8px;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.mode-btn:hover:not(.active) {
    color: var(--text);
}

/* Input Sections */
.input-section {
    margin-bottom: 1.5rem;
}

.input-section.hidden {
    display: none;
}

.input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-section input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
    font-family: var(--font-mono);
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: border-color 0.2s;
    text-align: center;
    letter-spacing: 0.1em;
}

.input-section input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.input-section input[type="text"]::placeholder {
    color: var(--text-muted);
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.permission-group {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.permission-group h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-light);
    text-align: center;
}

/* Custom Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary);
}

.perm-name {
    font-size: 0.9rem;
    color: var(--text);
}

.group-value {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-light);
}

/* Quick Picks */
.quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.quick-pick {
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.quick-pick:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Results */
.results {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-box {
    margin-bottom: 1rem;
}

.result-box.full-width {
    grid-column: 1 / -1;
}

.result-box label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.result-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-radius: 10px;
    min-height: 56px;
}

.result-value .result-text {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--success);
}

.command-result .result-text {
    font-size: 1rem;
    color: var(--text);
}

.copy-btn {
    padding: 0.4rem 0.6rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn.copied {
    background: var(--success);
}

/* Description Box */
.description-box {
    background: var(--bg);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.description-box label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.description-box p {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

/* Examples Section */
.examples {
    margin-bottom: 2rem;
}

.examples h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.example {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.example:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.example code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}

.example span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Reference Section */
.reference {
    margin-bottom: 2rem;
}

.reference h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.ref-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.ref-card h3 {
    font-size: 1rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.ref-card ul {
    list-style: none;
}

.ref-card li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ref-card code {
    font-family: var(--font-mono);
    color: var(--success);
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Support Section */
.support {
    background: linear-gradient(135deg, #1a1a2e, #252542);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.support h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.support p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.coffee-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ffdd00, #f9a825);
    color: #000;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.coffee-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 221, 0, 0.3);
}

/* Signup Section */
.signup {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.signup h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.signup p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.signup-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.signup-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

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

.signup-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.signup-form button:hover {
    background: var(--primary-dark);
}

.signup-note {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-coffee {
    margin-top: 1rem;
}

.footer-coffee a {
    color: #ffdd00;
    text-decoration: none;
    font-weight: 500;
}

.footer-coffee a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 700px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tool {
        padding: 1.25rem;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-row {
        grid-template-columns: 1fr;
    }
    
    .signup-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .result-value .result-text {
        font-size: 1rem;
    }
    
    .group-value {
        font-size: 1.5rem;
    }
}
