/* 파일 구조: xampp/htdocs/rent_project/ 파일명: style.css */
/* 설명: Rent Project 전체 공통 스타일, 사용자 대여/반납 화면, 관리자 화면, 모달 UI, 모바일 반응형, 로고 기반 고정 배경 스타일 */

/* =========================
   1. 기본 설정
========================= */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    margin: 0;
    padding: 0;
    font-family: Arial, "Noto Sans KR", sans-serif;
    color: #1f2f3d;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 30%),
        linear-gradient(135deg, #eaf8ff 0%, #d8f1ff 45%, #f7fcff 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("assets/logo.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: min(70vw, 520px) auto;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
}

button:disabled {
    cursor: not-allowed;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================
   2. 공통 레이아웃
========================= */

.page-wrap,
.login-wrap {
    position: relative;
    z-index: 1;
}

.page-wrap {
    width: 100%;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.header {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(180, 220, 240, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    max-width: 1180px;
    min-height: 72px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #22627f;
    letter-spacing: -0.3px;
}

.logo-with-image {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(118, 205, 255, 0.8));
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #2e6f8c;
    background-color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(165, 218, 242, 0.75);
    box-shadow: 0 4px 14px rgba(95, 180, 220, 0.12);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #7ed6ff, #4db8e8);
    border-color: transparent;
}

.page-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: #164b63;
}

.page-desc {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.6;
    color: #5c7d8c;
}

/* =========================
   3. 물품명별 그룹 표시
========================= */

.item-group {
    margin-bottom: 38px;
}

.item-group-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(160, 210, 235, 0.75);
}

.item-group-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #164b63;
}

.item-group-desc {
    margin: 0;
    font-size: 14px;
    color: #6c8b99;
}

/* =========================
   4. 물품 카드 목록
========================= */

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

.item-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(177, 221, 241, 0.85);
    box-shadow:
        0 10px 26px rgba(80, 170, 210, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 34px rgba(80, 170, 210, 0.22),
        0 0 0 3px rgba(125, 215, 255, 0.18);
}

.item-card.is-disabled {
    cursor: not-allowed;
}

.item-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dff5ff, #ffffff);
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.item-card.is-rented .item-image {
    filter: grayscale(100%);
    opacity: 0.45;
}

.item-status-label {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #5fd0ff, #2faee0);
    box-shadow: 0 4px 12px rgba(47, 174, 224, 0.35);
    z-index: 2;
}

.item-status-label.rented {
    background: linear-gradient(135deg, #ff8b8b, #e85757);
    box-shadow: 0 4px 12px rgba(232, 87, 87, 0.28);
}

.item-info {
    padding: 16px;
}

.item-name {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: #164b63;
}

.item-meta {
    margin: 0;
    font-size: 13px;
    color: #6c8b99;
    line-height: 1.5;
}

.item-action {
    width: 100%;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #6fd4ff, #35addf);
    box-shadow: 0 6px 16px rgba(53, 173, 223, 0.28);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.item-action:hover {
    background: linear-gradient(135deg, #4bc3f4, #209bd0);
}

.item-action:disabled {
    cursor: not-allowed;
    background: #a9c7d4;
    box-shadow: none;
}

/* =========================
   5. 빈 데이터 표시
========================= */

.empty-box {
    padding: 48px 20px;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.84);
    border: 1px dashed rgba(177, 221, 241, 0.85);
    text-align: center;
    color: #6b7280;
    box-shadow: 0 10px 26px rgba(80, 170, 210, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.empty-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    color: #164b63;
}

/* =========================
   6. 모달
========================= */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 20px;
    background-color: rgba(80, 130, 160, 0.38);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(180, 225, 245, 0.9);
    box-shadow:
        0 24px 60px rgba(70, 140, 180, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    overflow: hidden;
}

.modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(180, 220, 240, 0.75);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #164b63;
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: #eefaff;
    color: #2e6f8c;
    font-size: 20px;
    line-height: 1;
}

.modal-close:hover {
    background-color: #dff6ff;
}

.modal-body {
    padding: 22px;
}

.modal-item-name {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: #eefaff;
    color: #2e6f8c;
    font-size: 14px;
    font-weight: 700;
}

.modal-footer {
    padding: 0 22px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =========================
   7. 폼
========================= */

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #2e6f8c;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(150, 205, 232, 0.95);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    color: #111827;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #4bbde9;
    box-shadow: 0 0 0 3px rgba(95, 208, 255, 0.22);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.muted-text {
    margin-top: 6px;
    color: #9ca3af;
    font-size: 13px;
}

/* =========================
   8. 버튼
========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #6fd4ff, #35addf);
    box-shadow: 0 6px 16px rgba(53, 173, 223, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4bc3f4, #209bd0);
}

.btn-secondary {
    color: #2e6f8c;
    background-color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(165, 218, 242, 0.9);
}

.btn-secondary:hover {
    background-color: #e8f8ff;
}

.btn-danger {
    color: #ffffff;
    background: linear-gradient(135deg, #ff8b8b, #e85757);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff7474, #d93f3f);
}

.btn-success {
    color: #ffffff;
    background: linear-gradient(135deg, #68d69a, #23a85f);
}

.btn-success:hover {
    background: linear-gradient(135deg, #4fc785, #17894c);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* =========================
   9. 알림 메시지
========================= */

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    color: #166534;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
}

.alert-error {
    color: #991b1b;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
}

.alert-info {
    color: #1e3a8a;
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
}

/* =========================
   10. 관리자 로그인
========================= */

.login-wrap {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 380px;
    padding: 30px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(177, 221, 241, 0.85);
    box-shadow: 0 10px 26px rgba(80, 170, 210, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #164b63;
    text-align: center;
}

.login-desc {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6c8b99;
    text-align: center;
    line-height: 1.5;
}

/* =========================
   11. 관리자 대시보드
========================= */

.admin-top {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-panel {
    margin-bottom: 24px;
    padding: 22px;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(177, 221, 241, 0.85);
    box-shadow: 0 10px 26px rgba(80, 170, 210, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.admin-panel-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
    color: #164b63;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 160px 1fr auto;
    gap: 14px;
    align-items: end;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(177, 221, 241, 0.85);
    box-shadow: 0 10px 26px rgba(80, 170, 210, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table th,
.admin-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(190, 225, 242, 0.75);
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background-color: #eefaff;
    color: #2e6f8c;
    font-weight: 700;
}

.admin-table td {
    color: #25485a;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-thumb {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #e5e7eb;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-available {
    color: #13779e;
    background-color: #dff6ff;
}

.status-rented {
    color: #b12f2f;
    background-color: #ffe4e4;
}

.table-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.btn-small {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
}

/* =========================
   12. 로딩 및 비활성 상태
========================= */

.loading {
    pointer-events: none;
    opacity: 0.65;
}

.spinner-text {
    font-size: 14px;
    color: #6b7280;
}

.hidden {
    display: none !important;
}

/* =========================
   13. 태블릿 / 작은 화면
========================= */

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    body::before {
        background-position: center center;
        background-size: min(78vw, 380px) auto;
        opacity: 0.11;
    }

    .container {
        padding: 18px 14px 48px;
    }

    .header-inner {
        padding: 14px;
        gap: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .logo {
        font-size: 20px;
    }

    .logo-img {
        width: 56px;
        height: 56px;
    }

    .nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .nav-link {
        width: 100%;
        min-height: 42px;
        padding: 10px 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        border-radius: 10px;
        text-align: center;
    }

    .page-title {
        font-size: 23px;
        margin-bottom: 8px;
    }

    .page-desc {
        font-size: 14px;
        line-height: 1.55;
        margin-bottom: 20px;
    }

    .item-group {
        margin-bottom: 30px;
    }

    .item-group-header {
        margin-bottom: 12px;
    }

    .item-group-title {
        font-size: 20px;
    }

    .item-group-desc {
        font-size: 13px;
    }

    .item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .item-card {
        border-radius: 12px;
    }

    .item-card:hover {
        transform: none;
        box-shadow:
            0 10px 26px rgba(80, 170, 210, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .item-info {
        padding: 12px;
    }

    .item-name {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .item-meta {
        font-size: 12px;
        line-height: 1.4;
        min-height: 34px;
    }

    .item-action {
        min-height: 40px;
        margin-top: 10px;
        padding: 9px 8px;
        font-size: 13px;
    }

    .item-status-label {
        top: 8px;
        left: 8px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: 46px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
        font-size: 14px;
    }

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

    .admin-panel {
        padding: 16px;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-table-wrap {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 900px;
    }

    .modal-box {
        max-width: 100%;
    }
}

/* =========================
   14. 모바일 최적화
========================= */

@media (max-width: 480px) {
    body::before {
        background-position: center center;
        background-size: min(86vw, 320px) auto;
        opacity: 0.1;
    }

    .container {
        padding: 16px 12px 44px;
    }

    .header-inner {
        padding: 12px;
    }

    .logo {
        font-size: 20px;
    }

    .logo-img {
        width: 52px;
        height: 52px;
    }

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

    .nav-link {
        padding: 9px 6px;
        font-size: 13px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-desc {
        font-size: 13px;
    }

    .item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .item-image-wrap {
        aspect-ratio: 1 / 1;
    }

    .item-info {
        padding: 10px;
    }

    .item-name {
        font-size: 14px;
    }

    .item-meta {
        font-size: 12px;
        line-height: 1.4;
    }

    .item-action {
        width: 100%;
        font-size: 13px;
    }

    .empty-box {
        padding: 38px 16px;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-box {
        max-width: 100%;
        width: 100%;
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 18px 18px 14px;
    }

    .modal-title {
        font-size: 19px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-footer {
        padding: 0 18px 18px;
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .login-wrap {
        padding: 14px;
    }

    .login-box {
        padding: 24px 18px;
    }

    .login-title {
        font-size: 22px;
    }

    .admin-table {
        min-width: 900px;
    }
}

/* =========================
   15. 매우 작은 화면
========================= */

@media (max-width: 360px) {
    body::before {
        background-position: center center;
        background-size: min(90vw, 280px) auto;
        opacity: 0.09;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .item-grid {
        gap: 8px;
    }

    .item-info {
        padding: 9px;
    }

    .item-name {
        font-size: 13px;
    }

    .item-meta {
        font-size: 11px;
    }

    .item-action {
        min-height: 38px;
        font-size: 12px;
    }
}

/* =========================
   상단 안내 박스 / 섹션 구분
========================= */

.hero-box {
    margin-bottom: 34px;
    padding: 30px 32px;
    border-radius: 22px;
    background-color: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(177, 221, 241, 0.9);
    box-shadow:
        0 14px 34px rgba(80, 170, 210, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-box .page-title {
    margin-bottom: 12px;
}

.hero-box .page-desc {
    max-width: 900px;
    margin-bottom: 0;
}

.section-title-row {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(160, 210, 235, 0.75);
}

.section-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    color: #164b63;
}

.section-desc {
    margin: 0;
    font-size: 14px;
    color: #6c8b99;
}

/* 관리자 화면은 모바일에서도 PC 레이아웃 유지 */
body[data-page-mode="admin"] {
    overflow-x: auto;
}

body[data-page-mode="admin"] .container {
    min-width: 1100px;
}

body[data-page-mode="admin"] .header-inner {
    min-width: 1100px;
}

body[data-page-mode="admin"] .admin-table-wrap {
    overflow-x: visible;
}
