:root {
    --primary-color: #4e6aff; /* Brighter blue */
    --secondary-color: #7e42ff; /* Brighter purple */
    --accent-color: #5ad8ff;
    --success-color: #5bec93;
    --warning-color: #ffd04c;
    --danger-color: #ff8f8f;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --body-bg: #f8f9fa;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--body-bg);
    font-family: 'Noto Sans KR', 'Pretendard', sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
}

main {
    background-color: var(--body-bg);
    min-height: 100vh;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.custom-card {
    padding: 1rem;
    margin: 0.5rem 0;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.btn-detail {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-size: 0.9375rem;
}

@media (max-width: 767px) {
    main {
        font-size: 0.875rem;
        padding: 0.4rem;
    }

    .custom-card {
        padding: 0.8rem;
    }

    .card {
        padding: 0.8rem;
    }

    .card .badge {
        padding: 0.2rem 0.4rem;
        margin-right: 0.3rem;
        margin-bottom: 0.3rem;
        font-size: 0.7rem;
    }

    .card h3 {
        margin-top: 0.4rem;
        margin-bottom: 0.3rem;
        font-size: 1rem;
    }
}

.card {
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card .badge {
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    padding: 0.25rem 0.5rem;
}

.card .pb-5 {
    padding-bottom: 0.5rem !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Text spacing in cards */
.card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card div {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Improve spacing for price and region info */
.card div[style="padding: 3px 0;"] {
    padding: 0.4rem 0 !important;
    margin: 0.4rem 0;
}

/* Button container spacing */
.card .py-10 {
    padding-top: 0.6rem !important;
    padding-bottom: 0.4rem !important;
}

/* Tablet styles (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    main {
        padding: 0.8rem;
    }

    .card {
        padding: 1rem;
    }

    .card .badge {
        padding: 0.225rem 0.45rem;
        margin-right: 0.35rem;
        margin-bottom: 0.35rem;
    }

    .card h3 {
        margin-top: 0.5rem;
        margin-bottom: 0.35rem;
    }
}

/* Desktop styles (min 992px) */
@media (min-width: 992px) {
    main {
        max-width: 1140px;
        margin: 0 auto;
        padding: 1.5rem;
    }

    .card-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .custom-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .btn-detail {
        margin-top: auto;
    }
}

/* Margin and padding utilities */
.mb-10 {
    margin-bottom: 0.625rem;
}

.p-10 {
    padding: 0.625rem;
}

.py-10 {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.px-5 {
    padding-right: 0.3125rem;
    padding-left: 0.3125rem;
}

.px-10 {
    padding-right: 0.625rem;
    padding-left: 0.625rem;
}

.mt-10 {
    margin-top: 0.625rem;
}

.mr-10 {
    margin-right: 0.625rem;
}

.mb-15 {
    margin-bottom: 0.9375rem;
}

.pb-5 {
    padding-bottom: 0.3125rem;
}

/* Modern pagination styling */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
    margin-top: 1.25rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    margin: 0 0.125rem;
    text-decoration: none;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.25rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    font-weight: 500;
    font-size: 0.9375rem;
    min-width: 2rem;
    height: 2rem;
    cursor: pointer;
}

.page-link:hover {
    background-color: #6a82ff; /* Brighter than primary color */
    color: #fff;
    border-color: #6a82ff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.page-link.active {
    background-color: #6a82ff; /* Brighter than primary color */
    color: #fff;
    border-color: #6a82ff;
    font-weight: 600;
    z-index: 3;
}

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.3s ease-in-out, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
}

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

/* Color utilities */
.bg-primary {
    background-color: var(--primary-color);
    color: white;
}

.bg-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.bg-accent {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.bg-jd {
    background-color: var(--primary-color);
    color: white;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-jd:hover {
    background-color: #6a82ff; /* Brighter than primary color */
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: white;
}

.bg-gray {
    background-color: var(--gray-color);
    color: white;
}

.bg-light {
    background-color: var(--light-color);
}

.bg-white {
    background-color: #fff;
}

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

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

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

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

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

.text-blue {
    color: var(--primary-color);
}

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

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

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

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
    transition: all 0.2s ease-in-out;
}

/* Badge variants */
.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

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

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

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

/* Modern navigation bar */
.gnb {
    height: 3rem;
    display: flex;
    align-items: center;
    background: var(--dark-color);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    width: 100%;
    left: 0;
    right: 0;
}

.gnb a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    margin-right: 0.375rem;
    cursor: pointer;
}

.gnb a:hover {
    color: #7df2ff; /* Brighter accent color */
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.gnb a.active {
    color: #7df2ff; /* Brighter accent color */
    font-weight: 600;
}

.w-100 {
    width: 100%;
}

table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--dark-color);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

thead {
    background-color: rgba(0, 0, 0, 0.03);
}

th {
    text-align: left;
    padding: 0.6rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.12);
    vertical-align: middle;
    position: relative;
    color: var(--dark-color);
}

td {
    padding: 0.5rem 0.6rem;
    vertical-align: middle;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    line-height: 1.4;
    color: var(--gray-color);
    font-weight: 500;
}

tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
    transition: background-color 0.2s ease-in-out;
}

/* Detail page specific table styling */
.bg-white table {
    border: none;
    box-shadow: none;
}

.bg-white table td {
    width: 25%;
    padding: 0.5rem 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bg-white table th {
    width: 25%;
    font-weight: 600;
    color: var(--dark-color);
    padding: 0.5rem 0.8rem;
    border-bottom: none;
    background-color: transparent;
}

.bg-white table tr:first-child td,
.bg-white table tr:first-child th {
    border-top: none;
}

.bg-white table tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Responsive tables */
@media (max-width: 767px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Typography utilities */
.fs-sm {
    font-size: 0.875rem;
}

.fs-md {
    font-size: 0.9375rem;
}

.fs-18 {
    font-size: 1.125rem;
}

.fs-22 {
    font-size: 1.375rem;
}

.fw-4 {
    font-weight: 400;
}

.fw-5 {
    font-weight: 500;
}

.fw-6 {
    font-weight: 600;
}

.fw-7 {
    font-weight: 700;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-decoration-none {
    text-decoration: none;
}

/* Border utilities */
.border {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.border-top {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.border-bottom {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.border-0 {
    border: 0 !important;
}

.br-12 {
    border-radius: 0.75rem;
}

.br-8 {
    border-radius: 0.5rem;
}

.br-4 {
    border-radius: 0.25rem;
}

/* Form styling */
.form-control {
    display: block;
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--dark-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: text;
}

.form-control:focus {
    color: var(--dark-color);
    background-color: #fff;
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.125rem rgba(67, 97, 238, 0.2);
}

label {
    display: inline-block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.form-group {
    margin-bottom: 0.7rem;
}

/* Share button styling */
.bg-share {
    padding: 0.375rem 0.625rem;
    background: var(--accent-color);
    color: var(--dark-color);
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    text-decoration: none;
}

.bg-share:hover {
    background: #6a82ff; /* Brighter than primary color */
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
}

.bg-share i {
    font-size: 0.9375rem;
}

/* Additional padding utility */
.p-5 {
    padding: 0.3125rem;
}

/* Histories buttons specific styling */
#histories .btn {
    padding: 0.5rem 1rem;
    margin-right: 0.625rem;
    margin-bottom: 0.625rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, #4e6aff, #7e42ff); /* Using the new brighter colors */
    color: white;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
}

#histories .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #9a6aff, #6a82ff); /* Brighter gradient */
    color: white;
}

#histories .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
}

/* Loading indicator */
#loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 600;
    font-size: 0.9375rem;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    z-index: 1050;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#loading img {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.375rem;
}

/* Additional utility classes */
.shadow-sm {
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-circle {
    border-radius: 50%;
}

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

/* Flex utilities */
.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

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

.align-items-start {
    align-items: flex-start;
}

.align-items-end {
    align-items: flex-end;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-grow-1 {
    flex-grow: 1;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

/* Additional spacing utilities */
.my-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.mx-2 {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    background-color: #6a82ff; /* Brighter than primary color */
    border-color: #6a82ff;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: white;
}

.btn-secondary {
    background-color: var(--gray-color);
    border-color: var(--gray-color);
    color: white;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-secondary:hover {
    background-color: #868e96; /* Brighter gray */
    border-color: #868e96;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-success:hover {
    background-color: #6ff0a8; /* Brighter green */
    border-color: #6ff0a8;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-danger:hover {
    background-color: #ffa5a5; /* Brighter red */
    border-color: #ffa5a5;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: white;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #6a82ff; /* Brighter than primary color */
    border-color: #6a82ff;
    color: white;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Fix for button focus state */
.btn:focus, .btn:active:focus {
    outline: none;
    box-shadow: 0 0 0 0.125rem rgba(67, 97, 238, 0.25);
}

/* Fix for button cursor */
button, [type="button"], [type="reset"], [type="submit"] {
    cursor: pointer;
}

/* Display and visibility utilities */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.invisible {
    visibility: hidden !important;
}

.visible {
    visibility: visible !important;
}

/* Responsive display utilities */
@media (max-width: 767px) {
    .d-sm-none {
        display: none !important;
    }
    .d-sm-block {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    .d-md-block {
        display: block !important;
    }
}

/* Animation for loading and transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Position utilities */
.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.position-sticky {
    position: sticky !important;
}

.top-0 {
    top: 0 !important;
}

.bottom-0 {
    bottom: 0 !important;
}

.start-0 {
    left: 0 !important;
}

.end-0 {
    right: 0 !important;
}

.overflow-auto {
    overflow: auto !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-visible {
    overflow: visible !important;
}

.overflow-scroll {
    overflow: scroll !important;
}

.text-nowrap {
    white-space: nowrap !important;
}


/* Responsive container */
.container {
    width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    margin-right: auto;
    margin-left: auto;
    position: relative;
    z-index: 1;
}

.container-fluid {
    width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    margin-right: auto;
    margin-left: auto;
    position: relative;
    z-index: 1;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding-right: 0.6rem;
        padding-left: 0.6rem;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
        padding-right: 0.7rem;
        padding-left: 0.7rem;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }
}
