/* GENEL TEMA AYARLARI */
:root {
    --primary-color: #4c6ef5;
    --primary-color-hover: #3b5bdb;
    --secondary-color: #ff922b;
    --secondary-color-hover: #fd7e14;
    --success-color: #40c057;
    --danger-color: #fa5252;
    --warning-color: #fd7e14;
    --info-color: #15aabf;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --border-radius: 0.5rem;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --font-family: 'Inter', sans-serif;
    --header-height: 70px;
    --footer-height: 60px;
  }
  
  [data-theme="dark"] {
    --primary-color: #5c7cfa;
    --primary-color-hover: #4c6ef5;
    --secondary-color: #ff922b;
    --secondary-color-hover: #fd7e14;
    --success-color: #51cf66;
    --danger-color: #ff6b6b;
    --warning-color: #fcc419;
    --info-color: #22b8cf;
    --dark-color: #212529;
    --light-color: #343a40;
    --body-bg: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e9ecef;
    --text-muted: #adb5bd;
    --border-color: #343a40;
  }
  
  /* TEMEL STILLER */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    height: 100%;
  }
  
  body {
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    padding-bottom: calc(var(--footer-height) + 2rem);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
  }
  
  a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
  }
  
  a:hover {
    color: var(--primary-color-hover);
  }
  
  /* NAVBAR */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
    position: relative;
    z-index: 100;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .navbar-brand {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.25rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
  }
  
  .navbar-brand span {
    margin-left: 0.5rem;
  }
  
  .navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-right: auto;
    margin-left: auto;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
  }
  
  /* BUTONLAR */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    white-space: nowrap;
    text-align: center;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .btn i {
    margin-right: 0.5rem;
  }
  
  .btn-block {
    display: flex;
    width: 100%;
  }
  
  .btn-primary {
    background-color: var(--primary-color);
    color: white;
  }
  
  .btn-primary:hover {
    background-color: var(--primary-color-hover);
  }
  
  .btn-secondary {
    background-color: var(--secondary-color);
    color: white;
  }
  
  .btn-secondary:hover {
    background-color: var(--secondary-color-hover);
  }
  
  .btn-success {
    background-color: var(--secondary-color);
    color: white;
  }
  
  .btn-danger {
    background-color: var(--danger-color);
    color: white;
  }
  
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
  
  /* TEMA SWITCH */
  .theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
    flex-shrink: 0;
  }
  
  .theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
  }
  
  .theme-switch input {
    display: none;
  }
  
  .slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
  }
  
  .slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
  }
  
  input:checked + .slider {
    background-color: var(--primary-color);
  }
  
  input:checked + .slider:before {
    transform: translateX(20px);
  }
  
  .slider.round {
    border-radius: 34px;
  }
  
  .slider.round:before {
    border-radius: 50%;
  }
  
  .theme-switch-wrapper em {
    margin-left: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: normal;
  }
  
  /* CONTAINERLAR */
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - var(--header-height) - var(--footer-height) - 4rem);
  }
  
  /* AUTH SAYFALARI */
  .auth-page {
    background-color: var(--body-bg);
    overflow: hidden;
  }
  
  .auth-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  .auth-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
  }
  
  .auth-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    position: relative;
    overflow: hidden;
  }
  
  .auth-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  }
  
  .auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  .auth-header h2 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
  }
  
  .auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
  }
  
  .auth-form {
    margin-bottom: 1.5rem;
  }
  
  .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-direction: column;
    gap: 0;
  }
  
  .form-group {
    margin-bottom: 1rem;
    width: 100%;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
  }
  
  .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--body-bg);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s;
  }
  
  .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  .form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
  }
  
  .auth-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
  }
  
  /* ALERTLER */
  .alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .alert i {
    font-size: 1.2rem;
  }
  
  .alert-success {
    background-color: var(--success-color);
    color: white;
  }
  
  .alert-danger {
    background-color: var(--danger-color);
    color: white;
  }
  
  .alert-info {
    background-color: var(--info-color);
    color: white;
  }
  
  /* KİTAP ARAMA VE LİSTELEME */
  .search-container {
    margin-bottom: 2rem;
  }
  
  .search-form {
    margin-bottom: 1.5rem;
  }
  
  .search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius);
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-color);
  }
  
  .search-box button {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    width: 100%;
  }
  
  .sort-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .sort-options select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
  }
  
  .book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
  
  .book-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
  
  .book-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    background-color: var(--border-color);
  }
  
  .book-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  
  .book-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  
  .book-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
  }
  
  .book-stock {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stock-info {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }
  
  .stock-info.available {
    background-color: var(--success-color);
    color: white;
  }
  
  .stock-info.low {
    background-color: var(--danger-color);
    color: white;
  }
  
  .reservation-info {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
  }
  
  .reserved-info {
    font-size: 0.8rem;
  }
  
  .reserved-info i {
    color: var(--primary-color);
  }
  
  .book-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
  }
  
  .book-actions .btn {
    flex: none;
    width: 100%;
  }
  
  .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
  }
  
  .badge-info {
    background-color: rgba(21, 170, 191, 0.15);
    color: var(--info-color);
  }
  
  footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    padding: 1rem;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    z-index: 100;
  }
  
  /* RESPONSIVE */
  @media (max-width: 992px) {
    .navbar {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        height: auto;
        padding-bottom: 1rem;
        gap: 0.75rem 1rem;
    }

    .navbar-brand,
    .theme-switch-wrapper,
    .user-info {
        flex-shrink: 0;
        width: auto;
    }

    .navbar-brand {
        margin-right: 1rem;
    }

    .theme-switch-wrapper {
         margin-right: 1rem;
    }

    .navbar-nav {
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
        width: 100%;
        order: 1;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        flex-grow: 0;
    }

    .user-info {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

     .user-name-display {
        width: auto;
        justify-content: center;
     }

     .user-info .btn {
        width: 100%;
        justify-content: center;
     }
  }
  
  @media (max-width: 768px) {
    body {
        padding-bottom: calc(var(--footer-height) + 4rem);
        min-height: auto;
    }

    .container {
        padding: 1.5rem 1rem;
        min-height: calc(100vh - var(--header-height) - var(--footer-height) - 6rem);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1rem;
        padding: 1rem;
        height: auto;
    }
    
    .navbar-brand {
        margin-bottom: 0;
        margin-right: auto;
    }
    
    .theme-switch-wrapper {
        margin-bottom: 0;
        margin-right: 0;
        flex-shrink: 0;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        gap: 0.5rem;
        margin-right: 0;
        margin-left: 0;
        order: 1;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        justify-content: flex-start;
    }

    .navbar-nav .btn {
        width: 100%;
        justify-content: center;
    }

    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-box input {
         border-radius: var(--border-radius);
         border-right: 1px solid var(--border-color);
    }

    .search-box button {
        border-radius: var(--border-radius);
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .sort-options {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .sort-options select {
        width: 100%;
    }
    
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

     .book-card {
        display: flex;
        flex-direction: column;
     }

     .book-image {
         height: 180px;
         object-fit: cover;
         width: 100%;
     }

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

     .book-stock {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
     }

     .book-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: auto;
     }

     .book-actions .btn {
        width: 100%;
        flex: none;
        padding: 0.5rem 1rem;
     }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.95rem;
    }

    .book-title {
        font-size: 1.1rem;
    }

    .book-author {
        font-size: 0.85rem;
    }

    .book-stock span {
         font-size: 0.85rem;
    }

    .reserved-info {
         font-size: 0.85rem;
    }

    .theme-switch-wrapper em {
        font-size: 0.8rem;
    }

    footer {
        font-size: 0.8rem;
        padding: 1rem 0.75rem;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        justify-content: flex-start;
        order: 2;
    }

    .user-name-display {
        width: 100%;
        justify-content: flex-start;
    }

     .user-info .btn {
        width: 100%;
        justify-content: center;
     }

  }
  
  @media (max-width: 576px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .auth-container {
        padding: 0.75rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

    .form-text {
        font-size: 0.7rem;
    }

    .auth-link {
         font-size: 0.85rem;
    }

    .alert {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .alert i {
        font-size: 1rem;
    }

    .search-box input {
        font-size: 0.9rem;
    }

     .search-box button {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
     }

    .sort-options select {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }

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

     .book-image {
        height: 250px;
     }

     .book-title {
         font-size: 1.1rem;
     }

     .book-author {
         font-size: 0.85rem;
     }

     .book-stock span {
         font-size: 0.85rem;
     }

     .reserved-info {
          font-size: 0.85rem;
     }

     footer {
         font-size: 0.7rem;
         padding: 0.75rem 0.5rem;
     }

     .navbar-nav {
        gap: 0.5rem;
     }

     .navbar-nav .btn {
        width: 100%;
        justify-content: center;
     }

     .user-info {
        width: 100%;
        justify-content: center;
     }

     .user-name-display {
        width: 100%;
        justify-content: center;
     }

  }

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.user-name-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.user-name-display i {
    color: var(--primary-color);
}

.auth-form .btn {
    width: 100%;
}