/* Layout */
.coupon-wrapper {
    background: #faf8f8;
    min-height: 100vh;
    padding: 60px 0 100px;
}

.coupon-wrapper .container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
}

.coupon-add-box {
    background: #fff;
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 28px;
    border: 1px solid #efe0db; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.coupon-add-text h2 {
    font-size: 20px;
    font-weight: 700;
    color: #323232;
    margin-bottom: 8px;
}

.coupon-add-text p {
    font-size: 14px;
    color: #917e79;
}

.coupon-add-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}

.coupon-add-input {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid #d7dbef;
    font-size: 15px;
    background: #f8f9ff;
}

.coupon-add-input:focus {
    outline: none;
    border-color: #c76b52;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-add-coupon {
    padding: 0 24px;
    border-radius: 8px;
    background:#b58374;
    color: #fff;
    font-weight: 700;
    border: none;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap; 
    transition: 0.2s ease;
}

.btn-add-coupon:hover {
    background: #a27b6f;
}

@media (max-width: 768px) {
    .coupon-add-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .coupon-add-form {
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
    }

    .btn-add-coupon {
        width: 100%;
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .coupon-add-box {
        padding: 20px;
    }

    .coupon-add-text h2 {
        font-size: 18px;
    }
}

.page-title {
    font-size: 34px;
    font-weight: 800;
    color: #323232;
    text-align: center;
}

.page-subtitle {
    font-size: 15px;
    color: #917e79;
    margin-top: 6px;
}

/* 쿠폰 목록 아이템 (JS 동적 렌더링용) */
.coupon-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.coupon-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 10px; 
    border:1px solid #efe0db;
}

.coupon-discount {
    min-width: 150px;
    text-align: center; 
    border-right:1px solid #efe0db;
    padding:15px 15px 15px 0;
}

.coupon-discount-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #c76b52;
}

.coupon-discount-label {
    font-size: 1rem;
    color: #999;
}

.coupon-item .coupon-info {
    flex: 1;
    flex-direction: column;
}

.coupon-item .coupon-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333; 
}

.coupon-item .coupon-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.coupon-item .coupon-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: #aaa;
    flex-direction: row;
}

/* 쿠폰 배지 (렌탈 전용 / 일반구매 전용) */
.coupon-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.coupon-badge-rental {
    background: #dbeafe;
    color: #1e40af;
}

.coupon-badge-purchase {
    background: #fef3c7;
    color: #92400e;
}

/* 탭 네비게이션 (보유 쿠폰 / 사용 내역) */
.coupon-tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ece2df;
}

.coupon-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #9b847f;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.coupon-tab-btn:hover {
    color: #c76b52;
}

.coupon-tab-btn.active {
    color: #c76b52;
    border-bottom-color: #c76b52;
}

/* 사용 내역 목록 */
.coupon-history-list {
    display: grid;
    gap:12px;
    grid-template-columns: 1fr 1fr;
}

.coupon-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px; 
    border: 1px solid #efe0db;
}

.coupon-history-main {
    flex: 1;
}

.coupon-history-main .coupon-name {
    font-size: 1.0rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.coupon-code-text {
    font-size: 0.8rem;
    color: #aaa;
    font-family: monospace;
}

.coupon-history-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.coupon-history-discount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c76b52;
}

.coupon-history-action {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.coupon-h-wrap {
    display: flex;
    gap:10px;
    align-items: center;
    margin-bottom:10px;
}

.history-action-use    { background: #d1fae5; color: #065f46; }
.history-action-cancel { background: #fee2e2; color: #991b1b; }
.history-action-expire { background: #f1f5f9; color: #9b847f; }
.history-action-revoke { background: #fef3c7; color: #92400e; }

.coupon-history-date {
    font-size: 0.8rem;
    color: #aaa;
}

/* Tabs */
.coupon-tabs {
    background: #fff;
    border-radius: 28px;
    padding: 32px;
    border: 1px solid #e5d4cf;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
}

.coupon-tabs .tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 26px;
    background: #f4f6ff;
    border-radius: 18px;
    padding: 6px;
    border: 1px solid #e0e7ff;
}

.coupon-tabs .tab-button {
    flex: 1;
    padding: 14px 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #917e79;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#tab-available:checked ~ .tab-buttons label[for="tab-available"],
#tab-used:checked ~ .tab-buttons label[for="tab-used"] {
    background: #c76b52;
    color: #fff;
    box-shadow: 0 10px 20px rgba(99,102,241,0.35);
}

.tab-contents {
    margin-top: 10px;
}

.tab-content {
    display: none;
}

#tab-available:checked ~ .tab-contents #available-content,
#tab-used:checked ~ .tab-contents #used-content {
    display: block;
}

/* Coupon Cards */
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.coupon-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #e5d4cf;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    position: relative;
}

.coupon-value {
    font-size: 44px;
    font-weight: 800;
    color: #323232;
}

.coupon-value span {
    font-size: 18px;
    margin-left: 6px;
    font-weight: 700;
    color: #917e79;
}

.coupon-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coupon-name {
    font-size: 18px;
    font-weight: 700;
    color: #323232;
}

.coupon-desc {
    font-size: 14px;
    color: #917e79;
}

.coupon-meta {
    font-size: 13px;
    color: #9b847f;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coupon-status {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
}

.coupon-card.available .coupon-status {
    background: #f9f0ee;
    color: #ac756b;
}

.coupon-card.used .coupon-status {
    background: #fef3c7;
    color: #92400e;
}

/* Responsive */
@media (max-width: 1024px) {
    .coupon-wrapper .container {
        padding: 0 24px;
    }

    .coupon-list,.coupon-history-list {
    grid-template-columns:  1fr;
}

}

@media (max-width: 768px) {
    .coupon-wrapper {
        padding: 40px 0 70px;
    }

    .coupon-wrapper .container {
        padding: 0 18px;
    }

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

    .coupon-tabs {
        padding: 20px;
    }

    .coupon-grid {
        grid-template-columns: 1fr;
    }

    .modal-panel {
        width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .tab-buttons {
        flex-direction: column;
    }

    .coupon-value {
        font-size: 36px;
    }
}
