/**
 * 사용자 시스템 스타일 (user-rental-page.html)
 * 노트북 대여 시스템 - 사용자 페이지 전용 CSS
 */

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 캠퍼스 테마 배경 */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #7fb3d3;
  min-height: 100vh;
  color: #333;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23pattern)"/></svg>');
  pointer-events: none;
  z-index: 0;
}

/* 컨테이너 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* 기존 헤더 스타일 제거됨 - integrated-header로 대체 */
/* .header 단독 스타일링은 더 이상 사용하지 않음 */
  font-weight: 700;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* 통합 헤더 스타일 */
.integrated-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(255,255,255,0.95);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: 1px solid #e8f4f8;
}

.header-logo {
  flex-shrink: 0;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.1);
}

.header-logo img {
  height: 50px;
  max-width: 150px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.header-content {
  flex: 1;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.12) 100%);
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.header-content h1 {
  font-size: 1.8em;
  color: #2d3748;
  margin: 0 0 5px 0;
  font-weight: bold;
}

.header-content p {
  color: #718096;
  margin: 0;
  font-size: 1em;
}

/* 사용자 정보 카드 */
.user-info-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 15px 20px;
  background: rgba(255,255,255,0.95);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: 1px solid #e8f4f8;
}

.user-details h3 {
  margin: 0 0 3px 0;
  color: #2d3748;
  font-size: 1.1em;
  font-weight: 600;
}

.user-details p {
  margin: 0;
  color: #718096;
  font-size: 0.9em;
}

.logout-btn {
  padding: 8px 16px;
  background: #f56565;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: #e53e3e;
}

.user-card {
  background: rgba(255,255,255,0.9);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 200px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.3);
}

.user-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 5px;
}

.user-details {
  color: #666;
  font-size: 0.9rem;
}

.logout-btn {
  background: #f5d6a3;
  color: #8b4513;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245,214,163,0.4);
}

.logout-btn:hover {
  background: #f0c78a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,214,163,0.6);
}

/* 네비게이션 탭 */
.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: rgba(255,255,255,0.9);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.tab-button {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background: #ddd;
  color: #666;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-button.active {
  background: #a8d5f0;
  color: #1a365d;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(168,213,240,0.4);
}

/* 대여 신청 탭 활성화 시 (파란색 테마) */
.tab-button.rental-tab.active {
  background: #3498db;
  color: white;
  box-shadow: 0 5px 15px rgba(52,152,219,0.4);
}

/* 내 대여 내역 탭 활성화 시 (초록색 테마) */
.tab-button.history-tab.active {
  background: #27ae60;
  color: white;
  box-shadow: 0 5px 15px rgba(39,174,96,0.4);
}

.tab-button:hover:not(.active) {
  background: #e8e8e8;
  transform: translateY(-1px);
}

/* 탭 콘텐츠 */
.tab-content {
  display: none;
  background: rgba(255,255,255,0.95);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.tab-content.active {
  display: block;
}

/* 섹션 제목 */
.section-title {
  font-size: 1.8rem;
  color: #2d3748;
  margin-bottom: 25px;
  text-align: center;
  font-weight: 700;
}

/* 히스토리 테이블용 컨테이너 */
.history-table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin: 20px 0;
}

.laptop-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 800px;
}

.laptop-table th {
  background: #7fb3d3 !important;
  background-image: none !important;
  color: #2c3e50 !important;
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.laptop-table th:hover {
  background: #6bb6ff !important;
}

.laptop-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.3s ease;
}

.laptop-table tbody tr:hover {
  background: #f8f9ff;
}

/* 상태 표시 */
.status-available {
  color: #27ae60;
  font-weight: bold;
}

.status-rented {
  color: #e74c3c;
  font-weight: bold;
}

.status-pending {
  color: #f39c12;
  font-weight: bold;
}

.status-maintenance {
  color: #9b59b6;
  font-weight: bold;
}

/* 스크롤 힌트 */
.scroll-hint {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-top: 10px;
  display: none;
}

/* 대여 신청 폼 */
.rental-form {
  background: #f8f9ff;
  padding: 25px;
  border-radius: 15px;
  margin-top: 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border: 2px solid rgba(102,126,234,0.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2d3748;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
  transform: translateY(-1px);
}

/* 제출 버튼 */
.submit-btn {
  background: #7fb3d3;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
  width: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.6);
}

.submit-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 대여 내역 테이블 */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-table th {
  background: #7fb3d3 !important;
  background-image: none !important;
  color: #2c3e50 !important;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.history-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.history-table tr:hover {
  background: #f1f5f9;
}

/* 데이터가 없을 때 */
.no-data {
  text-align: center;
  padding: 40px;
  color: #718096;
  font-style: italic;
}

/* 필터 컨트롤 */
.filter-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-controls select,
.filter-controls input {
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.filter-controls select:focus,
.filter-controls input:focus {
  outline: none;
  border-color: #667eea;
}

/* 데이터 출처 표시 */
.data-source {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.excel-source {
  background: #e8f5e8;
  color: #2d5a2d;
}

.hardcode-source {
  background: #fff3cd;
  color: #856404;
}

.unknown-source {
  background: #f8d7da;
  color: #721c24;
}

/* 상태 배지 스타일 */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.status-available {
  background: #d1ecf1;
  color: #0c5460;
}

.status-rented {
  background: #fff3cd;
  color: #856404;
}

.status-pending {
  background: #f8d7da;
  color: #721c24;
}

.status-maintenance {
  background: #d6d8db;
  color: #383d41;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-completed {
  background: #cce7ff;
  color: #004085;
}

.status-overdue {
  background: #f5c6cb;
  color: #721c24;
}

.status-approved {
  background: #d1ecf1;
  color: #0c5460;
}

.status-rejected {
  background: #f8d7da;
  color: #721c24;
}

/* 사용자 장비 테이블 컨테이너 */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin: 20px auto;
  width: 100%;
  max-width: 1200px;
}

/* 사용자 장비 테이블 컬럼 너비 */
#userDeviceTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: fixed;
  margin: 0 auto;
}

#userDeviceTable th:nth-child(1) { width: 12%; } /* 장비ID */
#userDeviceTable th:nth-child(2) { width: 12%; } /* 제조사 */
#userDeviceTable th:nth-child(3) { width: 18%; } /* 모델 */
#userDeviceTable th:nth-child(4) { width: 12%; } /* 상태 */
#userDeviceTable th:nth-child(5) { width: 14%; } /* 대여자/요청자 */
#userDeviceTable th:nth-child(6) { width: 14%; } /* 대여일/요청일 */
#userDeviceTable th:nth-child(7) { width: 14%; } /* 반납예정일 */
#userDeviceTable th:nth-child(8) { width: 14%; } /* 대여신청 */

#userDeviceTable th {
  background: #7fb3d3 !important;
  background-image: none !important;
  color: #2c3e50 !important;
  padding: 15px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  word-wrap: break-word;
}

#userDeviceTable td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.3s ease;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* 테이블 전체 영역을 화면에 맞춤 */
#userDeviceTable {
  min-width: 100% !important;
}

/* 컨테이너도 전체 너비 사용 */
.table-container {
  width: 100% !important;
  max-width: none !important;
}

#userDeviceTable tbody tr:hover {
  background: #f8f9ff;
}

/* 모든 테이블 헤더에서 그라데이션 완전 제거 - 밝은 톤으로 수정 */
table th,
thead th,
#userDeviceTable th,
.laptop-table th,
.user-table th,
.history-table th {
  background: #a8d5f0 !important;
  background-image: none !important;
  background-attachment: initial !important;
  background-clip: initial !important;
  background-origin: initial !important;
  background-position: initial !important;
  background-repeat: initial !important;
  background-size: initial !important;
  color: #1a365d !important;
  font-weight: bold !important;
  text-shadow: none !important;
}

/* 액션 버튼 스타일 */
.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.2;
}

.rent-btn {
  background: #98d982;
  color: #2c3e50;
  box-shadow: 0 2px 4px rgba(0, 184, 148, 0.3);
}

.rent-btn:hover {
  background: #8fbc8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 184, 148, 0.4);
}

.rent-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 184, 148, 0.3);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .integrated-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 15px;
  }

  .header-content h1 {
    font-size: 1.5em;
  }

  .header-logo img {
    height: 40px;
  }

  .user-info-card {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 12px 15px;
  }

  .dual-layout-container {
    flex-direction: column !important;
    gap: 15px !important;
  }

  .left-panel, .right-panel {
    padding: 15px !important;
  }
}

/* 대여 신청 폼 애니메이션 */
@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
  }
}

@keyframes slideUp {
  0% {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
  }
}

.rental-form.hide {
  animation: slideUp 0.3s ease-in forwards;
}
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .user-info {
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 15px;
    margin: 10px 0;
  }
  
  .user-card {
    padding: 15px;
    font-size: 0.9rem;
  }
  
  .nav-tabs {
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }
  
  .tab-button {
    padding: 12px 20px;
    font-size: 0.9rem;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }
  
  .tab-content {
    padding: 20px;
  }
  
  .section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
  
  .table-container {
    margin: 15px 0;
  }
  
  .laptop-table {
    font-size: 0.8rem;
  }
  
  .laptop-table th,
  .laptop-table td {
    padding: 8px 4px;
  }
  
  .scroll-hint {
    display: block;
  }
  
  .rental-form {
    padding: 20px;
    margin-top: 20px;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .submit-btn {
    padding: 12px 25px;
    font-size: 1rem;
  }
  
  .filter-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .filter-controls select,
  .filter-controls input {
    width: 100%;
  }
}