/* ==========================================================================
   Variables & Root Settings
   ========================================================================== */
   :root {
    /* Dark Theme (Default) */
    --primary-color: #3498db;
    --accent-color: #2980b9;
    --text-color: #f5f5f5;
    --bg-color: #121212;
    --panel-bg: #202020;
    --panel-border: #3a3a3a;
    --input-bg: #2a2a2a;
    --card-bg: #2a2a2a;
    --card-hover-bg: #333333;
    --floor-1-color: #e74c3c;
    --floor-2-color: #3498db;
    --floor-3-color: #2ecc71;
    --floor-4-color: #f39c12;
    --floor-5-color: #9b59b6;
    
    /* Light Theme Variables */
    --light-primary-color: #2196F3;
    --light-accent-color: #1976D2;
    --light-text-color: #333333;
    --light-bg-color: #f5f5f5;
    --light-panel-bg: #ffffff;
    --light-panel-border: #e0e0e0;
    --light-input-bg: #ffffff;
    --light-card-bg: #f0f0f0;
    --light-card-hover-bg: #e5e5e5;
  }
  
  /* ==========================================================================
     Reset & Base Styles
     ========================================================================== */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
  }
  
  body.light-theme {
    --primary-color: var(--light-primary-color);
    --accent-color: var(--light-accent-color);
    --text-color: var(--light-text-color);
    --bg-color: var(--light-bg-color);
    --panel-bg: var(--light-panel-bg);
    --panel-border: var(--light-panel-border);
    --input-bg: var(--light-input-bg);
    --card-bg: var(--light-card-bg);
    --card-hover-bg: var(--light-card-hover-bg);
  }
  
  /* ==========================================================================
     Layout & Structure
     ========================================================================== */
  .main-header {
    padding: 40px 20px 20px;
    text-align: center;
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  }
  
  .header-container {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
  }
  
  .search-container {
    margin-bottom: 25px;
  }
  
  .filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .professors-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }
  
  .results-info {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #aaa;
  }
  
  .floor-legend {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    max-width: 200px;
  }
  
  .floor-legend h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--text-color);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 8px;
  }
  
  .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  .legend-item span:last-child {
    margin-left: 10px;
  }
  
  .empty-results {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--panel-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .empty-results i {
    font-size: 3rem;
    color: #666;
    margin-bottom: 20px;
  }
  
  .empty-results p {
    margin-bottom: 20px;
    color: #aaa;
  }
  
  .main-footer {
    margin-top: 50px;
    padding: 20px;
    text-align: center;
    background-color: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    font-size: 0.9rem;
    color: #888;
  }
  
  /* ==========================================================================
     Components
     ========================================================================== */
  
  /* --- Header --- */
  h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
  }
  
  .subtitle {
    font-size: 1.1rem;
    color: #888;
  }
  
  /* --- Search --- */
  .search-box {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .search-input {
    width: 100%;
    padding: 15px 50px;
    border-radius: 30px;
    border: none;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s, transform 0.3s;
  }
  
  .search-input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }
  
  .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
  }
  
  .clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
  }
  
  .clear-search:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
  }
  
  /* --- Filters --- */
  .filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
  }
  
  .filter-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #aaa;
  }
  
  .filter-select {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--panel-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
    cursor: pointer;
  }
  
  .filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  .reset-btn {
    margin-left: auto;
    align-self: flex-end;
    background-color: transparent;
    border: 1px solid var(--panel-border);
    color: #888;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
  }
  
  .reset-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
  }
  
  .clear-filters-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
  }
  
  .clear-filters-btn:hover {
    background-color: var(--accent-color);
  }
  
  /* --- Professor Cards --- */
  .professor-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    height: 100%;
  }
  
  .professor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    background-color: var(--card-hover-bg);
  }
  
  .professor-image {
    width: 100px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    border-right: 1px solid var(--panel-border);
  }
  
  .professor-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  
  .professor-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1rem;
  }
  
  .professor-title {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  
  .professor-location {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .office-number {
    font-weight: bold;
    color: var(--primary-color);
  }
  
  .office-details {
    color: #aaa;
    font-size: 0.85rem;
  }
  
  .floor-badge {
    display: inline-block;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 25px;
    font-size: 0.8rem;
    font-weight: bold;
  }
  
  .floor-1 {
    background-color: var(--floor-1-color);
  }
  
  .floor-2 {
    background-color: var(--floor-2-color);
  }
  
  .floor-3 {
    background-color: var(--floor-3-color);
  }
  
  .floor-4 {
    background-color: var(--floor-4-color);
  }
  
  .floor-5 {
    background-color: var(--floor-5-color);
  }
  
  /* --- Theme Toggle --- */
  .theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
  }
  
  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--panel-bg);
    color: var(--text-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s, transform 0.1s;
    font-size: 18px;
  }
  
  .theme-toggle-btn:hover {
    background-color: var(--primary-color);
  }
  
  .theme-toggle-btn:active {
    transform: scale(0.95);
  }
  
  /* --- Footer --- */
  .credit-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
  }
  
  .credit-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
  }
  
  /* ==========================================================================
     Responsive Design
     ========================================================================== */
  @media (max-width: 768px) {
    .professors-container {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .filters-container {
      flex-direction: column;
      gap: 10px;
    }
    
    .filter-group {
      width: 100%;
    }
    
    .reset-btn {
      margin-top: 10px;
      align-self: flex-start;
      margin-left: 0;
    }
    
    .floor-legend {
      display: none;
    }
    
    .main-header {
      padding: 30px 15px 15px;
    }
    
    h1 {
      font-size: 1.8rem;
    }
    
    .subtitle {
      font-size: 1rem;
    }
  }
  
  @media (max-width: 480px) {
    .professors-container {
      grid-template-columns: 1fr;
    }
    
    .professor-card {
      max-width: 100%;
    }
    
    .main-content {
      padding: 0 15px;
    }
    
    .search-input {
      padding: 12px 45px;
      font-size: 0.9rem;
    }
  }
  
  /* ==========================================================================
     Animations
     ========================================================================== */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .professor-card {
    animation: fadeIn 0.3s ease-out forwards;
  }
  
  .professor-card:nth-child(1) { animation-delay: 0.05s; }
  .professor-card:nth-child(2) { animation-delay: 0.1s; }
  .professor-card:nth-child(3) { animation-delay: 0.15s; }
  .professor-card:nth-child(4) { animation-delay: 0.2s; }
  .professor-card:nth-child(5) { animation-delay: 0.25s; }
  .professor-card:nth-child(6) { animation-delay: 0.3s; }
  .professor-card:nth-child(7) { animation-delay: 0.35s; }
  .professor-card:nth-child(8) { animation-delay: 0.4s; }
  .professor-card:nth-child(9) { animation-delay: 0.45s; }
  .professor-card:nth-child(10) { animation-delay: 0.5s; }


/* Logo */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    position: relative;
}
.tishk-logo {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    margin-right: 20px;
}
.header-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
    }
    .header-text {
        position: static;
        transform: none;
        margin-top: 10px;
    }
    .tishk-logo {
        margin-right: 0;
    }
}