@use '../styles/variables' as *;

.home-container {
  padding: 20px;
  
  .category-tabs {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background-color: #141414;
    z-index: 10;
    padding-bottom: 10px;
    
    .category-tab {
      padding: 8px 16px;
      font-size: 16px;
      cursor: pointer;
      position: relative;
      color: rgba(255, 255, 255, 0.65);
      
      &:hover {
        color: rgba(255, 255, 255, 0.85);
      }
      
      &.active {
        color: #fff;
        font-weight: 500;
        
        &:after {
          content: '';
          position: absolute;
          bottom: -10px;
          left: 0;
          width: 100%;
          height: 2px;
          background-color: $primary-color;
        }
      }
    }
    
    .category-shuffle {
      margin-left: auto;
      color: rgba(255, 255, 255, 0.65);
      
      &:hover {
        color: #fff;
      }
    }
  }
  
  .media-group {
    margin-bottom: 40px;
    
    &.highlight-group {
      margin-bottom: 48px;
      
      .highlight-icon {
        color: #ff4d4f;
        margin-right: 8px;
      }
    }
    
    .premium-icon {
      color: #ffc53d;
      margin-right: 8px;
    }
    
    .media-group-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      
      h4.ant-typography {
        margin: 0;
        color: rgba(255, 255, 255, 0.85);
      }
      
      .ant-btn-link {
        color: rgba(255, 255, 255, 0.45);
        
        &:hover {
          color: $primary-color;
        }
      }
    }
    
    .media-items {
      margin-bottom: 20px;
    }
    
    .featured-items {
      margin-bottom: 20px;
    }
  }
  
  .featured-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
    
    &:hover {
      .featured-overlay {
        opacity: 1;
      }
    }
    
    .featured-image {
      position: relative;
      height: 0;
      padding-top: 56.25%; // 16:9 比例
      overflow: hidden;
      
      img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      
      .featured-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transition: opacity 0.3s;
        
        .featured-play-button {
          background-color: rgba(24, 144, 255, 0.8);
          color: white;
          border-radius: 20px;
          padding: 6px 16px;
          font-size: 14px;
          font-weight: bold;
          
          &:hover {
            background-color: $primary-color;
          }
        }
        
        .featured-rating {
          position: absolute;
          top: 10px;
          right: 10px;
          background-color: rgba(0, 0, 0, 0.6);
          color: #ffc53d;
          border-radius: 4px;
          padding: 2px 6px;
          font-size: 12px;
          font-weight: bold;
        }
      }
    }
    
    .featured-info {
      padding: 16px;
      flex: 1;
      display: flex;
      flex-direction: column;
      
      .featured-title {
        margin-bottom: 8px;
        color: rgba(255, 255, 255, 0.85);
      }
      
      .featured-meta {
        display: flex;
        margin-bottom: 8px;
        color: rgba(255, 255, 255, 0.45);
        font-size: 12px;
        
        .year, .runtime, .rating {
          margin-right: 12px;
          
          &:last-child {
            margin-right: 0;
          }
        }
      }
      
      .featured-overview {
        color: rgba(255, 255, 255, 0.65);
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
    }
  }
  
  .loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
  }
  
  .empty-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
  }
  
  .media-card {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s;
    
    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
      
      .card-overlay {
        opacity: 1;
      }
      
      .card-cover-container img {
        transform: scale(1.05);
      }
    }
    
    .card-cover-container {
      position: relative;
      height: 0;
      padding-top: 150%; // 2:3 比例适合电影封面
      overflow: hidden;
      background-color: #2a2a2a;
      
      img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        transition: transform 0.3s;
      }
      
      .card-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.1) 100%);
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transition: opacity 0.3s;
        
        .card-play-button {
          background-color: rgba(24, 144, 255, 0.8);
          color: white;
          border-radius: 20px;
          padding: 4px 12px;
          font-size: 12px;
          
          &:hover {
            background-color: rgba(24, 144, 255, 1);
          }
        }
      }
      
      .card-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        background-color: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 2px 8px;
        font-size: 12px;
        border-radius: 4px;
      }
    }
    
    .card-content {
      padding: 12px;
      
      .card-title {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 4px;
        color: rgba(255, 255, 255, 0.85);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      
      .card-meta {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.45);
        display: flex;
        align-items: center;
        
        .card-year {
          margin-right: 8px;
        }
        
        .card-rating {
          display: flex;
          align-items: center;
          
          .rating-icon {
            color: #ffc53d;
            margin-right: 2px;
            font-size: 12px;
          }
        }
      }
    }
  }
}

.server-alert {
  margin-top: 40px;
  
  .ant-alert-description {
    margin-top: 16px;
    
    p {
      margin-bottom: 16px;
    }
  }
} 