.coupon-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-self: stretch;
}

.coupon-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: start;
}

.coupon-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.coupon-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coupon-filters {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-self: stretch;
}

/* --- SEARCH BAR --- */
.coupon-search {
    position: relative;
    width: 100%;
    align-self: stretch;
}

/* add padding for icon only in search */
.coupon-search .coupon-input {
    padding-left: 36px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
}

/* --- SHARED STYLE FOR INPUT & SELECT --- */
.coupon-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    color: #000;
    background-color: #fff;
    font-family: inherit;
    transition: border-color 0.2s ease;
    appearance: none;
}

/* --- FOCUS & DISABLED STATES --- */
.coupon-input:focus {
    border-color: #3369d5;
    outline: none;
}

.coupon-input:disabled {
    background-color: #d9d9d9;
}

.coupon-select {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.select-input {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #000 !important;
    background-color: #fff !important;
    font-family: inherit !important;
    transition: border-color 0.2s ease !important;
    appearance: none !important;
    height: 100% !important;
}

/* Optional: Add custom dropdown arrow */
.select-input {
    background: url("data:image/svg+xml;utf8,<svg fill='%23666' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 7l4.5 4.5L14.5 7z'/></svg>") no-repeat right 12px center/12px auto !important;
}

/* --- BUTTON --- */
.create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #28a745;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.create-btn i {
    font-size: 16px;
}

.create-btn:hover {
    background: #218838;
}

/* coupon list */
#coupon-list-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.coupon-list-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coupon-list-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.coupon-list-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.coupon-list-image img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* overlay container */
.coupon-status-price {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    z-index: 2;
}

/* tags */
.coupon-status-price .tag {
    background-color: rgb(239, 233, 233);
    color: #fff;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.coupon-info {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex-grow: 1;
    justify-content: space-between; 
}

.coupon-meta-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coupon-type {
    display: flex;
    gap: 6px;
}

.tag {
    background-color: rgb(239, 233, 233);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.coupon-meta-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-self: stretch;
    align-items: start;
}

.coupon-price {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.coupon-date-time {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: start;
    font-size: small;
    font-weight: 400;
}

.coupon-date,
.coupon-time {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
}

.coupon-actions {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.coupon-action-btn {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
}

.coupon-actions .btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.coupon-actions .btn-primary {
    background: #13294b;
    color: #fff;
}

.coupon-actions .btn-primary:hover {
    background: #1d3a70;
}

/* add gift bags modal */
.coupon-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

/* larger modal box */
.coupon-modal-container {
    background-color: #fff;
    margin: 3% auto;
    border-radius: 16px;
    width: 95%;
    max-width: 850px;
    max-height: 90vh;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* header styling */
.coupon-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 20px 28px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* close button */
.coupon-close {
    cursor: pointer;
    font-size: 26px;
    font-weight: bold;
    color: #555;
    transition: color 0.2s ease;
}

.coupon-close:hover {
    color: #000;
}

/* optional: make modal content scrollable if it grows too long */
.coupon-modal-container::-webkit-scrollbar {
    width: 6px;
}

.coupon-modal-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.create-form {
    display: grid;
    gap: 20px;
    align-self: stretch;
    padding: 30px;
}

.create-left {
    display: flex;
    grid-column: span 2 / span 2;
    flex-direction: column;
    align-items: start;
    gap: 20px;
    align-self: stretch;
}

.create-right {
    display: flex;
    grid-column: span 2 / span 2;
    flex-direction: column;
    align-items: start;
    gap: 20px;
    align-self: stretch;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: start;
    align-self: stretch;
}

.create-label {
    display: block;
    font-weight: 500;
    font-size: small;
}

.create-required {
    color: red;
    font-size: small;
    font-weight: 500;
}

/* input fields */
.create-input {
    display: block;
    width: 100%;
    all: unset;
    box-sizing: border-box;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #000;
    background-color: #f8f8f8;
    transition: border-color 0.2s ease;
}

.create-input:focus {
    border-color: #3369d5;
    outline: none;
}

.create-input:disabled {
    background-color: #d9d9d9;
}

.create-date {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #000 !important;
    background-color: #fff !important;
    font-family: inherit !important;
    transition: border-color 0.2s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    line-height: normal !important;
    height: 40.4px !important;
    padding: 10px;
}

.create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 10px;
    width: 100%;
}

.create-discount-field {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-self: stretch;
}

.member-tier {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.select-tier {
    padding: 10px 12px;
    background-color: #f8f8f8;
    border-radius: 6px;
}

.select-tier-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.create-giftbag-btn {
    display: flex;
    justify-content: flex-end;
    align-self: stretch;
    width: 100%;
    padding: 0px 20px 20px 0px;
}

/* coupon detail */
.coupon-detail-modal-container {
    background-color: #fff;
    margin: 3% auto;
    border-radius: 16px;
    width: 95%;
    max-width: 850px;
    max-height: 90vh;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#couponDetailBody {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
}

.detail-header-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 22px;
    align-items: center;
}

.detail-image {
    width: 150px;
    height: 150px;
    background-color: #f0f0f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.header-content .tags {
    display: flex;
    gap: 8px;
}

.header-content .tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: white;
}

.tag.not-yet-valid {
    background-color: #fef3c7;
    color: #92400e;
}

.tag.expired {
    background-color: #e5e7eb;
    color: #374151;
}

.tag.can-use {
    background-color: #dcfce6;
    color: #016730;
}

.tag.new {
    background-color: #f3e8ff;
    color: #6e10b1;
}

.tag.discount {
    background-color: #fb2c37;
    color: white;
}

.header-content .detail-name {
    font-size: 20px;
    font-weight: bold;
    color: #13294b;
}

.header-content .description {
    font-size: 14px;
    color: #333;
}

.detail-info-flex {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.coupon-detail-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 15px;
    width: 100%;
}

.info-header {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    font-size: 16px;
    color: black;
    font-weight: 500;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-label {
    font-weight: bold;
    font-size: 15px;
}

.info-field {
    font-weight: 400;
    font-size: small;
}

.coupon-instruction {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.instructor-header {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #016730;
}

.instructor-content {
    font-size: 13px;
    color: #016730;
}

.coupon-detail-oriprice {
    font-weight: bold; 
    font-size:x-large; 
    color:#13294b;
}

.coupon-detail-price {
    font-weight: 400; 
    font-size:medium; 
    text-decoration:line-through;
}

@media(max-width: 540px) {
    .detail-info-flex {
        flex-direction: column;
    }

    .coupon-price .coupon-detail-oriprice {
        font-size: small;
    }

    .coupon-price .coupon-detail-price {
        font-size: x-small;
    }
}

/* --- RESPONSIVE (below 764px) --- */
@media (max-width: 764px) {
    .coupon-filters {
        flex-direction: column;
        gap: 12px;
    }

    .coupon-search,
    .coupon-select {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .select-input,
    .coupon-input,
    .create-btn {
        width: 100% !important;
    }

    .create-btn {
        font-size: 14px;
        padding: 10px;
    }
}

@media (min-width: 764px) {
    .create-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .coupon-filters {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    #coupon-list-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #coupon-list-container {
        grid-template-columns: 1fr;
    }

    .coupon-list-image img {
        height: 250px;
    }
}