/* ================================================================
   ŘemeslníciOnline — Main Stylesheet
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
    --primary:     #e67e22;
    --primary-dark: #d35400;
    --secondary:   #2c3e50;
    --light-bg:    #f8f9fa;
    --border:      #dee2e6;
    --text-muted:  #6c757d;
    --radius:      0.5rem;
    --shadow:      0 2px 12px rgba(0,0,0,.08);
}

/* ── Base ──────────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

main { flex: 1; }

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary) !important;
}

.navbar-brand span { color: var(--secondary); }

.navbar { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* ── Hero Section (Homepage) ───────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #3d5a74 100%);
    color: white;
    padding: 5rem 0;
}

.hero h1 { font-size: 2.8rem; font-weight: 700; }
.hero p  { font-size: 1.2rem; opacity: .9; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); }

/* ── Craftsman Card ─────────────────────────────────────────────── */
.craftsman-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
}
.craftsman-card .avatar-wrap {
    position: relative;
    margin-top: -50px;
    margin-left: 1rem;
}
.craftsman-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}
.craftsman-card .badge-promoted {
    position: absolute;
    top: 8px;
    right: 8px;
}
.craftsman-card .category-tags .badge {
    font-size: .75rem;
    margin: 2px;
}

/* ── Star Rating ────────────────────────────────────────────────── */
.star-rating { font-size: .9rem; }
.rating-summary {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.rating-number { font-weight: 600; font-size: 1.1rem; }
.rating-count  { color: var(--text-muted); font-size: .85rem; }

/* ── Dashboard Sidebar ──────────────────────────────────────────── */
.sidebar {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
}
.sidebar-header {
    background: var(--secondary);
    color: white;
    padding: 1.5rem;
    text-align: center;
}
.sidebar-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.3);
    object-fit: cover;
    margin-bottom: .75rem;
}
.sidebar-nav .nav-link {
    color: #444;
    padding: .7rem 1.2rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: #f0f0f0;
    color: var(--primary);
}
.sidebar-nav .nav-link i { width: 1.2rem; text-align: center; }

/* ── Stats Cards (Dashboard) ────────────────────────────────────── */
.stat-card {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
}
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table thead th { background-color: var(--secondary); color: white; border: none; }
.table tbody tr:hover { background-color: #f8f9fa; }

/* ── Gallery Grid ───────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    transition: opacity .3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.gallery-item:hover .overlay { opacity: 1; }

/* ── Lightbox ────────────────────────────────────────────────────── */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
}
#lightbox.active { display: flex; }
#lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    user-select: none;
}
#lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: .8;
    transition: opacity .2s;
    background: none;
    border: none;
    padding: 0;
}
#lightbox-close:hover { opacity: 1; }
#lightbox-prev,
#lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    opacity: .7;
    transition: opacity .2s;
    background: none;
    border: none;
    padding: .25rem .75rem;
    user-select: none;
}
#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }
#lightbox-prev:hover,
#lightbox-next:hover { opacity: 1; }
#lightbox-counter {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.6);
    font-size: .85rem;
    pointer-events: none;
}

/* ── Message Thread ─────────────────────────────────────────────── */
.message-list { max-height: 500px; overflow-y: auto; padding: 1rem; }
.message-bubble {
    max-width: 70%;
    padding: .75rem 1rem;
    border-radius: 1rem;
    margin-bottom: .75rem;
    font-size: .9rem;
}
.message-bubble.sent {
    background: var(--primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: .25rem;
}
.message-bubble.received {
    background: white;
    box-shadow: var(--shadow);
    border-bottom-left-radius: .25rem;
}
.message-bubble .time {
    font-size: .75rem;
    opacity: .7;
    margin-top: .25rem;
}

/* ── Quote Comparison ───────────────────────────────────────────── */
.quote-compare-card {
    border: 2px solid transparent;
    transition: border-color .2s;
}
.quote-compare-card:hover { border-color: var(--primary); }
.quote-compare-card.best-price { border-color: #28a745; }
.quote-price { font-size: 1.8rem; font-weight: 700; color: var(--primary); }

/* ── Catalog Filters ────────────────────────────────────────────── */
.filter-panel {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}
.filter-panel h5 { font-weight: 600; margin-bottom: 1rem; color: var(--secondary); }

/* ── Availability Badge ─────────────────────────────────────────── */
.availability-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.availability-dot.available   { background: #28a745; }
.availability-dot.busy        { background: #ffc107; }
.availability-dot.unavailable { background: #dc3545; }

/* ── Notification Bell ──────────────────────────────────────────── */
.notif-bell { position: relative; }
.notif-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: .65rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ── Promoted Card ──────────────────────────────────────────────── */
.craftsman-card.is-promoted {
    border-top-width: 2px !important;
    border-top-style: solid !important;
}
.craftsman-card .promo-icon {
    font-size: 1rem;
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 1;
}

/* ── Profile Page ───────────────────────────────────────────────── */
.profile-banner {
    height: 250px;
    object-fit: cover;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(135deg, var(--secondary) 0%, #3d5a74 100%);
}
.profile-avatar-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    margin-top: -60px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
    background: var(--secondary);
    color: rgba(255,255,255,.8);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}
.footer a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1rem;
    margin-top: 2rem;
    font-size: .85rem;
    color: rgba(255,255,255,.5);
}

/* ── Form Styles ────────────────────────────────────────────────── */
.form-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.form-section h4 {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--primary);
}

/* ── Auth Pages ─────────────────────────────────────────────────── */
.auth-card {
    max-width: 480px;
    margin: 3rem auto;
}
.auth-card .card-header {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius) var(--radius) 0 0;
}
.auth-card .card-header h2 { margin: 0; font-weight: 700; }

/* ── Page Header ────────────────────────────────────────────────── */
.page-header {
    background: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.page-header h1 { font-size: 1.8rem; font-weight: 700; margin: 0; color: var(--secondary); }

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 4rem; margin-bottom: 1rem; opacity: .3; }

/* ── Card search (shared with dashboard pages) ───────────────────── */
.admin-card-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.admin-card-search input {
    padding: .25rem .5rem .25rem 1.75rem;
    font-size: .78rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    outline: none;
    width: 170px;
    transition: border-color .15s, width .2s;
}
.admin-card-search input:focus {
    border-color: #0d6efd;
    width: 210px;
    background: #fff;
}
.admin-card-search input::placeholder { color: #6c757d; }
.admin-card-search i {
    position: absolute;
    left: .5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: .72rem;
    pointer-events: none;
    line-height: 1;
}

/* ── Responsive Adjustments ─────────────────────────────────────── */
@media (max-width: 768px) {
    .hero h1  { font-size: 2rem; }
    .hero      { padding: 3rem 0; }
    .sidebar   { margin-bottom: 1.5rem; position: static; }
    .filter-panel { position: static; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
