/* Moderní CSS pro aukce a bazar */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-menu a {
    color: var(--dark-color);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-menu a:hover {
    background: var(--light-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px;
    margin: 20px 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.item-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-color);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 3rem;
}

.no-image.large {
    height: 400px;
}

.item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.item-badge.bazar {
    background: var(--secondary-color);
}

.item-badge.external {
    background: #f39c12;
}

/* Externí položky */
.external-item {
    border: 2px solid #f39c12;
    position: relative;
}

.external-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #f39c12;
}

.external-item .item-content h3 a {
    color: #f39c12;
}

.external-item .item-content h3 a:hover {
    color: #e67e22;
}

/* Externí upozornění */
.external-notice {
    background: #fff3cd;
    border: 2px solid #f39c12;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.external-notice p {
    margin-bottom: 15px;
    color: #856404;
}

.external-notice .btn {
    margin-top: 10px;
}

/* Image Gallery */
.image-gallery {
    position: relative;
}

.main-image-container {
    position: relative !important;
    width: 100%;
    max-width: 450px;
    margin: 0 0 15px 0;
    overflow: visible !important;
    border-radius: 10px;
    background: #000;
    min-height: 200px;
}

.main-image-container .main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s;
    border-radius: 10px;
}

.gallery-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(74, 144, 226, 0.9) !important;
    color: white !important;
    border: 3px solid white !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 1.8rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.gallery-nav:hover {
    background: rgba(74, 144, 226, 1) !important;
    border-color: white !important;
    transform: translateY(-50%) scale(1.2) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8) !important;
}

.gallery-nav:active {
    transform: translateY(-50%) scale(1.1) !important;
}

.gallery-prev {
    left: 20px !important;
}

.gallery-next {
    right: 20px !important;
}

.gallery-nav i {
    pointer-events: none;
    display: block !important;
    line-height: 1 !important;
    font-size: 1.8rem !important;
}

.gallery-nav .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Fallback pokud Font Awesome nefunguje */
.gallery-nav:not(:has(i))::before {
    content: '‹';
    font-size: 2rem;
    font-weight: bold;
}

.gallery-nav.gallery-next:not(:has(i))::before {
    content: '›';
}

/* Zajištění viditelnosti */
.auction-images .gallery-nav,
.bazar-images .gallery-nav,
.image-gallery .gallery-nav {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
}

/* Debug - zobrazit šipky vždy */
.image-gallery .main-image-container .gallery-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.image-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
}

.image-thumbnails {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.image-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.image-thumbnails::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 10px;
}

.image-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.thumbnails-scroll {
    display: flex;
    gap: 10px;
    padding: 0 5px;
}

.image-thumbnails .thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    opacity: 0.7;
    flex-shrink: 0;
}

.image-thumbnails .thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.image-thumbnails .thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 45px;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10000;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

#lightboxImage {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    z-index: 10000;
}

/* Keyboard navigation hint */
.lightbox::before {
    content: 'ESC pro zavření';
    position: absolute;
    top: 30px;
    left: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    z-index: 10000;
}

.item-content {
    padding: 20px;
}

.item-content h3 {
    margin-bottom: 10px;
}

.item-content h3 a {
    color: var(--dark-color);
    text-decoration: none;
}

.item-content h3 a:hover {
    color: var(--primary-color);
}

.item-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.item-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.item-meta {
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
}

.item-meta i {
    margin-right: 5px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h1 {
    color: var(--dark-color);
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 20px;
}

/* Featured Section */
.featured-section {
    margin: 40px 0;
}

.featured-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.section-footer {
    text-align: center;
    margin-top: 30px;
}

/* Detail Pages */
.auction-detail,
.bazar-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.auction-images,
.bazar-images {
    position: relative;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
}

.auction-info h1,
.bazar-info h1 {
    margin-bottom: 20px;
}

.auction-meta,
.bazar-meta {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-color);
    border-radius: 5px;
}

.auction-meta p,
.bazar-meta p {
    margin: 5px 0;
}

.auction-description,
.bazar-description {
    margin: 20px 0;
}

.auction-bidding {
    margin: 30px 0;
    padding: 20px;
    background: var(--light-color);
    border-radius: 10px;
}

.price-info {
    margin: 20px 0;
}

.current-price,
.starting-price,
.buy-now-price {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin: 10px 0;
    background: white;
    border-radius: 5px;
}

.current-price .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.time-remaining {
    margin: 20px 0;
    text-align: center;
}

.countdown-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.bid-form {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 5px;
}

.bids-history {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.bids-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.bids-table th,
.bids-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.bids-table th {
    background: var(--light-color);
    font-weight: bold;
}

.bazar-price h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 20px 0;
}

.bazar-contact {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-color);
    border-radius: 5px;
}

.bazar-stats {
    margin: 20px 0;
    color: #666;
}

/* Forms */
.create-form,
.auth-form {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.auth-form {
    max-width: 400px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

/* Admin */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.admin-links {
    margin: 30px 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--light-color);
    font-weight: bold;
}

.rss-feeds-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.rss-feeds-list {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.external-filters {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Profile */
.profile-page {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.profile-sections {
    margin: 30px 0;
}

.profile-section {
    margin: 30px 0;
}

/* No Items */
.no-items {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-items i {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    margin-top: 60px;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 10px 0;
}

.footer-section a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #bbb;
}

/* Countdown */
.countdown {
    font-weight: bold;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .auction-detail,
    .bazar-detail {
        grid-template-columns: 1fr;
    }
    
    .main-image-container {
        max-width: 100%;
    }
    
    .main-image-container .main-image {
        max-height: 400px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .filter-form {
        flex-direction: column;
    }
}
