/* Base Styles */
body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease-in-out;
}

/* Header Styles */
.main-header {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
    padding-right: 1.5rem;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
    position: relative;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Footer Styles */
.main-footer {
    background-color: #2c3e50;
    padding: 0 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
    margin-top: auto;
    padding-right: 1.5rem;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
    position: relative;
}

/* Logo Styles */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 50px;
    width: auto;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.store-title {
    color: #ecf0f1 !important;
    margin-left: 1rem;
    font-size: 1.5rem;
    text-align: left;
    flex: 0 1 auto;
    transition: font-size 0.3s ease, text-align 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.search-bar {
    align-items: center;
    flex-wrap: nowrap;
    flex-grow: 1;
    min-width: 150px;
    max-width: 600px;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    transition: max-width 0.3s ease, flex-grow 0.3s ease;
    margin: 0 auto;
}

.search-bar input {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    border: 1px solid #ced4da;
    transition: padding 0.3s ease, border-color 0.3s ease;
    max-width: 500px;
    min-width: 200px;
}

.search-bar button {
    flex-shrink: 0;
    white-space: nowrap;
}

.cart-link {
    color: #ecf0f1 !important;
    text-decoration: none;
    position: static;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

.cart-total {
    white-space: nowrap;
}

/* Flash Messages */
.messages {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.messages li {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    transition: padding 0.3s ease, margin-bottom 0.3s ease;
    animation: fadeOut 5s ease forwards;
}

.messages .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.messages .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; }
}

/* Item Listing Styles */
.item-group {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: padding 0.3s ease, margin-bottom 0.3s ease;
}

.item-header {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.versions-list {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: center;
    white-space: nowrap;
    grid-template-columns: 1fr;
}

.version-card {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-direction: row !important;
}

.version-info {
    flex-grow: 1;
    margin-right: 2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: margin-right 0.3s ease, flex-grow 0.3s ease;
}

.version-title {
    color: #34495e;
    margin-bottom: 0.1rem;
    overflow: hidden;
    transition: color 0.3s ease, margin-bottom 0.3s ease;
}

.badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    min-width: max-content;
    height: 30px;
    text-align: center;
}

.version-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.version-details .badge {
    flex-grow: 1;
    text-align: center;
}

.badge.bg-secondary {
    background-color: #7f8c8d !important;
}

.badge.bg-foil {
    background-color: #f506f5 !important;
}

.price {
    color: #27ae60;
    font-weight: bold;
}

.stock {
    color: #2980b9;
}

.cart-form .input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: auto;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
}

/* Cart Styles */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    transition: width 0.3s ease;
    display: block;
}

th {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* New Cart Card Enhancements */
.card.border-success {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, #eafff2 0%, #d1f5e4 100%);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.card.border-secondary {
    border-color: #6c757d !important;
    background-color: #ffffff;
}

.grand-total-box {
    background-color: #f1f8f4;
    border-left: 4px solid #28a745;
    padding: 1rem;
    border-radius: 6px;
    font-weight: bold;
}

/* Utility Classes */
.mt-4 {
    margin-top: 1.5rem;
    transition: margin-top 0.3s ease;
}

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

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    transition: padding 0.3s ease, font-size 0.3s ease;
}

.quantity-input {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
    flex-shrink: 0;
    margin: 0;
}

.cart-form button {
    white-space: nowrap;
    padding: 0.5rem 1rem;
}

td .form-control {
    padding: 0.25rem 0.5rem;
}

td form {
    margin: 0;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: padding 0.3s ease, font-size 0.3s ease;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

@media (max-width: 576px) {
    .header-nav {
        gap: 0.5rem;
    }

    .search-bar {
        max-width: 250px;
    }

    .search-bar input {
        min-width: 80px;
    }

    .search-bar button {
        padding: 0.4rem;
    }

    .cart-link {
        order: 2;
    }

    .badge {
        width: 80px;
        min-width: 100px;
        height: 25px;
        line-height: 25px;
        font-size: 0.85rem;
        padding: 0.3rem 0.8rem;
    }

    .cart-form .input-group {
        width: 100%;
    }

    .quantity-input {
        width: 60px;
    }

    .cart-form button {
        width: auto;
    }

    .card-body {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .card-body form {
        align-self: flex-end;
    }
}

/* Hero Section Styles */
.hero {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.hero-btn {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
}

/* Featured Cards Section Styles */
.featured-cards {
    background-color: #f8f9fa;
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 2rem;
    text-align: center;
}

.card {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.card-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
    margin-top: 0.5rem;
}

.card-text {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.card .btn-success {
    margin-top: 1rem;
}

/* Why Shop Section */
.why-shop {
    padding: 3rem 0;
}

.feature-item {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.feature-item h5 {
    font-size: 1.5rem;
    font-weight: bold;
}

.feature-item p {
    font-size: 1rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

/* CTA Section */
.cta {
    background-color: #3498db;
    color: white;
    padding: 3rem 0;
}

.cta h2 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta .btn-primary {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    border-radius: 25px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-btn {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }

    .featured-cards .card {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cta h2 {
        font-size: 2rem;
    }
}
