/* ============================================================
   Kotki Kędziorki — Minimalistyczny styl portalu
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #2c2c2c;
    --color-text-secondary: #666;
    --color-primary: #5a6e8a;
    --color-primary-hover: #47596f;
    --color-accent: #e8a87c;
    --color-border: #e0e0e0;
    --color-success: #4caf50;
    --color-error: #e74c3c;
    --color-warning: #f39c12;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Header --- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.site-logo:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.site-logo-sub {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-status {
    font-size: 0.85rem;
    color: var(--color-success);
}

.nav-link {
    font-size: 0.9rem;
}

/* --- Main --- */
.site-main {
    flex: 1;
    padding: 2rem 1rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* --- Hub: App Cards Grid --- */
.hub-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.hub-intro h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hub-intro p {
    color: var(--color-text-secondary);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.app-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text);
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.app-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.app-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.app-card-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    flex: 1;
}

.app-card-badge {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
}

.badge-public {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-private {
    background: #fff3e0;
    color: #e65100;
}

.badge-planned {
    background: #f5f5f5;
    color: #999;
}

/* --- Login Form --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(90, 110, 138, 0.15);
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--color-error);
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* --- Flash Messages --- */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.flash-error {
    background: #fdecea;
    color: var(--color-error);
    border: 1px solid #f5c6cb;
}

.flash-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.flash-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-secondary { color: var(--color-text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- App Content (placeholder styling) --- */
.app-header {
    margin-bottom: 1.5rem;
}

.app-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.app-header p {
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* --- Table --- */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
}
