/**
 * TycoSim v0.3 - Components
 * Buttons, Cards, Forms, Modals, Navbar, Footer, Utilities
 */

/* ===== Buttons ===== */
.btn {
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-1);
    cursor: pointer;
    font-size: var(--font-size-md);
    font-weight: 500;
    transition: all 0.2s ease;
    color: white;
    background-color: var(--accent);
    display: inline-block;
    text-align: center;
    user-select: none;
}

.btn:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-secondary {
    background-color: var(--surface-3);
    color: var(--text);
}

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

.btn-danger {
    background-color: var(--danger);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===== Cards ===== */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-1);
    padding: var(--space-5);
    box-shadow: var(--shadow-2);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border);
}

.card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.card-body {
    margin-bottom: var(--space-4);
}

.card-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--space-4);
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-1);
    background-color: var(--surface-2);
    color: var(--text);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.modal-body {
    margin-bottom: var(--space-4);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* Modal Close Button - standardisiert */
.modal-close {
    color: var(--muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

/* ===== Navbar ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: var(--shadow-1);
}

.navbar-brand {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--success);
}

.navbar-menu {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
    text-align: center;
    color: var(--muted);
    font-size: var(--font-size-sm);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 999;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-version {
    color: var(--accent);
    font-weight: 600;
}

.footer-divider {
    color: var(--border);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-1);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background-color: rgba(47, 210, 122, 0.2);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 165, 36, 0.2);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(255, 77, 79, 0.2);
    color: var(--danger);
}

.badge-info {
    background-color: rgba(79, 140, 255, 0.2);
    color: var(--accent);
}

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: var(--space-5);
}

.mb-20 {
    margin-bottom: var(--space-5);
}

/* ===== Additional Utilities (T-0302) ===== */
.link-accent {
    color: var(--accent);
    text-decoration: none;
}

.link-accent:hover {
    color: var(--success);
}

.text-muted {
    color: var(--muted);
}

.navbar-stat {
    font-weight: bold;
    color: var(--success);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.flex-row {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.flex-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.min-w-300 {
    min-width: 300px;
}

.w-80 {
    width: 80px;
}

.w-full {
    width: 100%;
}

.gap-10 {
    gap: var(--space-3);
}

.grid {
    display: grid;
}

.align-center {
    align-items: center;
}

.no-margin {
    margin: 0;
}

.font-09 {
    font-size: 0.9em;
}

/* ===== Icons ===== */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

.icon-sm {
    width: 0.875em;
    height: 0.875em;
}

.icon-lg {
    width: 1.5em;
    height: 1.5em;
}

.icon-xl {
    width: 2em;
    height: 2em;
}