@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.reservation-wrap {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 80vh;
    padding: 2rem 0;
}

.reservation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
.res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.res-title {
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.res-nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.res-nav a:hover, .res-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Grid Layout for Items */
.item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 1024px) { .item-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .item-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .item-grid { grid-template-columns: 1fr; } }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}
.pagination button {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.pagination button:hover:not(:disabled) {
    background: #f1f5f9;
}
.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.item-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.item-img-wrap {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect ratio */
    background: #f1f5f9;
    overflow: hidden;
}

.item-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s;
}

.item-card:hover .item-img-wrap img {
    transform: scale(1.05);
}

.item-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-type {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.item-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    color: var(--text-main);
}

.item-stock {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.item-stock strong {
    color: #10b981;
}

.btn-reserve {
    margin-top: auto;
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    cursor: pointer;
}

.btn-reserve:hover {
    background-color: var(--primary-hover);
    color: white;
}

.btn-reserve:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

/* Detail Page */
.detail-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .detail-wrap {
        grid-template-columns: 1fr;
    }
}

.detail-img img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 1rem;
    background: #f1f5f9;
}

.detail-content h2 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.price-tag {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* My Page */
.mypage-list {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.my-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1.5rem;
}

.my-item:last-child {
    border-bottom: none;
}

.my-img {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.5rem;
    object-fit: contain;
}

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

.my-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.my-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.badge-renting {
    background-color: #dcfce3;
    color: #166534;
}

.btn-extend {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-extend:hover {
    background-color: var(--primary-hover);
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
