/**
 * Netto-Brutto-Rechner 2026 - Component Styles
 * Reusable UI Components: Cards, Tabs, Buttons, Forms
 */

/* ===== Glassmorphism Card ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.card-inner {
    padding: 2rem;
}

/* ===== Folder Tab Navigation ===== */
.folder-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    padding-left: 0;
    position: relative;
    z-index: 10;
}

.folder-tab {
    display: block;
    padding: 0.55rem 1.2rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    position: relative;
}

.folder-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    border-bottom: none;
    z-index: 12;
    margin-bottom: -1px;
    padding-bottom: 0.65rem;
}

.folder-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 13;
}

.folder-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
    color: var(--text);
    transform: translateY(-2px);
    text-decoration: none;
}

/* ===== Folder Tab Dropdown ===== */
.folder-tab-dropdown {
    position: relative;
}

.folder-tab-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    line-height: inherit;
}

.folder-tab-dropdown summary svg {
    flex-shrink: 0;
}

.folder-tab-dropdown summary::-webkit-details-marker {
    display: none;
}

.folder-tab-dropdown summary::marker {
    content: '';
}

.folder-tab-dropdown[open] summary svg {
    transform: rotate(180deg);
}

.folder-tab-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
}

.folder-tab-dropdown[open] .folder-tab-menu {
    display: block;
}

.folder-tab-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.15s;
}

.folder-tab-link:hover {
    background: rgba(16, 185, 129, 0.15);
    text-decoration: none;
}

.folder-tab-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 50;
    cursor: pointer;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-dark);
}

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

.btn-success:hover {
    background: #059669;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== Grid Layouts ===== */
.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Info Boxes ===== */
.info-box {
    background: var(--input-bg);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
    backdrop-filter: blur(10px);
}

.info-box.warning {
    border-color: var(--warning);
}

.info-box.success {
    border-color: var(--success);
}

.highlight-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.highlight-box p {
    margin: 0;
}

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

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

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

/* ===== Responsive Adjustments ===== */
@media (max-width: 640px) {
    .folder-tabs {
        gap: 1px;
    }

    .folder-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Hide emoji icons inside folder tabs on mobile - show only text */
    .folder-tab .tab-icon {
        display: none;
    }

    .card {
        padding: 1.25rem;
        border-radius: 0 16px 16px 16px;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Extra small screens: horizontal scroll with minimum readable size */
@media (max-width: 400px) {
    .folder-tabs {
        gap: 0;
    }

    .folder-tab {
        padding: 0.35rem 0.4rem;
        font-size: 0.65rem;
        border-radius: 6px 6px 0 0;
    }
}
