/* discord-widget.css */
@import url('/fonts.css');
@import url('/tailwind.css');
@import url('/app/global.css');

html, body {
  font-family: var(--font-inter) !important;
  margin: 0;
  padding: 0;
}

.main-container {
    width: 100vw;
    /* background-color: #0f0f0e; */
    background-color: black;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;

    /* border-top: 1px dashed #343536;
    border-bottom: 1px solid #343536; */
}

.community-title {
    text-transform: uppercase;
    font-family: var(--font-inter) !important;
    font-weight: 900 !important;
    font-size: 2rem !important;
    color: white !important;    
    text-align: center !important;
    margin: 0 0 2.5rem 0 !important;
    text-rendering: optimizeLegibility !important;
}

.widgets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1100px;
    width: 100%;
    padding: 2rem;

    background-color: #131314;
    border: 1px solid #202121;
    border-radius: 1rem;
}

.discord-widget {
    border: 1px solid #343536;

    border-radius: .5rem;
}

/******************/
/* REDDIT SECTION */
/******************/

.reddit-widget {
    width: 100%;
    height: 550px;
    background: #1A1A1B;
    border: 1px solid #343536;
    overflow: hidden;

    border-radius: .5rem;
}

.widget-header {
    /* background: #FF4500; */

    /* background: #F04000; */
    /* background: #E63900; */
    background: hsl(16 calc(var(--saturation-factor,1)*100%) 50%);
    padding: 1.375rem;
    display: flex;
    align-items: center;
    gap: .625rem;
}

.reddit-icon {
    width: 1.875rem;
    height: 1.875rem;
    fill: white;
}

.subreddit-name {
    font-weight: bold;
    font-size: 1rem;
    /* color: white; */
    color: #FFFFFF;
}

.posts-container {
    height: calc(100% - 108px);
    overflow-y: auto;
    padding: 0;
}

.post-item {
    padding: 12px 15px;
    border-bottom: 1px solid #343536;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-item:hover {
    background: #262729;
}

.post-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #D7DADC;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #818384;
}

.upvotes {
    color: #FF4500;
    font-weight: 500;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #818384;
}

.error {
    padding: 20px;
    text-align: center;
    color: #ff6b6b;
}

/* Custom scrollbar */
.posts-container::-webkit-scrollbar {
    width: 6px;
}

.posts-container::-webkit-scrollbar-track {
    background: #1A1A1B;
}

.posts-container::-webkit-scrollbar-thumb {
    background: #343536;
    border-radius: 3px;
}

.posts-container::-webkit-scrollbar-thumb:hover {
    background: #4F5152;
}

.member-count {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    position: relative;
}

.join-community-tab {
    color: white;

    /* color: black;
    background-color: white;
    border-radius: 50px;
    padding: 15px 35px; */

    text-transform: uppercase;
    font-family: var(--font-inter) !important;
    font-weight: 500 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    
    text-decoration: none !important;
    
    margin-top: 2.5rem !important;
    transition: opacity 0.6s ease !important;
    text-rendering: optimizeLegibility !important;
}

.join-community-tab:hover {
    opacity: 0.6 !important;
}

/* Green dot for online indicator */
.online-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: rgb(1 168 22);
    /* background:
        linear-gradient(217deg, rgb(4, 255, 0), transparent 70.71%),
        linear-gradient(127deg, rgb(17, 235, 17), transparent 70.71%); */
    border-radius: 50%;
    margin-right: 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.tabs-container {
    display: flex;
    background: #262729;
    border-bottom: 1px solid #343536;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #818384;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    background: #343536;
    color: #D7DADC;
}

.tab.active {
    color: #FF4500;
    border-bottom-color: #FF4500;
    background: #1A1A1B;
}




/* Responsive design */
/* @media (max-width: 768px) {
    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .community-title {
        font-size: 1.5rem !important;
    }
} */








/* Making discord-widget.php responsive on all devices */

/* Desktop | 1281px - 1440px  */
@media (max-width: 1280px) {
  /* None, coded on macbook m1 pro */
}

/* Medium Laptop/Desktop | 1515px - 1920px */
@media (max-width: 1515px) {
 /* None, coded on macbook m1 pro */
}

/* Small Laptop/Desktop | 1024px - 1280px */
@media (max-width: 1024px) {
  /* None, coded on macbook m1 pro */
}

/* Mobile Small Portrait (Normal) () | up to 480px */
/* S20+, iPhone 12, iPhone 13 */
@media (max-width: 480px) and (orientation: portrait) {
  .main-container {
    padding: 2rem 1rem;
  }
  
  .community-title {
    font-size: 1.5rem !important;
    margin: 0 0 2rem 0 !important;
  }
  
  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 20rem;
  }
  
  .discord-widget {
    height: 400px;
  }
  
  .reddit-widget {
    height: 450px;
  }
  
  .widget-header {
    padding: 1rem;
  }
  
  .subreddit-name {
    font-size: 0.9rem;
  }
  
  .member-count {
    font-size: 0.75rem;
    text-align: right;
    max-width: 90px;
  }
  
  .post-title {
    font-size: 0.8rem;
  }
  
  .post-meta {
    font-size: 0.7rem;
  }
  
  .tab {
    padding: 8px;
    font-size: 0.75rem;
  }
  
  .join-community-tab {
    margin-top: 2rem !important;
    font-size: 0.85rem;
  }
}

/* Mobile Small Landscape (Seitlich gehlaten) | up to 950px */
/* S20+, iPhone 14, iPhone 15 Pro in Landscape (Seitlich gehlaten) */
@media (max-width: 950px) and (orientation: landscape) {
  .main-container {
    padding: 1.5rem 4rem;
  }
  
  .community-title {
    font-size: 1.75rem !important;
    margin: 0 0 1.5rem 0 !important;
  }
  
  .widgets-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    max-width: none;
  }
  
  .discord-widget {
    height: 350px;
  }
  
  .reddit-widget {
    height: 350px;
  }
  
  .widget-header {
    padding: 0.875rem;
  }
  
  .subreddit-name {
    font-size: 0.85rem;
  }
  
  .member-count {
    font-size: 0.7rem;
  }
  
  .post-title {
    font-size: 0.75rem;
  }
  
  .post-meta {
    font-size: 0.65rem;
  }
  
  .tab {
    padding: 6px;
    font-size: 0.7rem;
  }
  
  .join-community-tab {
    margin-top: 1.5rem !important;
    font-size: 0.8rem;
  }
}

/* Mobile Large Portrait (Normal) | 481px - 600px */
/* iPhone 14 Pro Max, Pixel 7 Pro, larger phones */
@media (min-width: 481px) and (max-width: 600px) and (orientation: portrait) {
  .main-container {
    padding: 2.5rem 1.5rem;
  }
  
  .community-title {
    font-size: 1.75rem !important;
    margin: 0 0 2.25rem 0 !important;
  }
  
  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.25rem;
    max-width: none;
  }
  
  .discord-widget {
    height: 450px;
  }
  
  .reddit-widget {
    height: 500px;
  }
  
  .widget-header {
    padding: 1.125rem;
  }
  
  .subreddit-name {
    font-size: 0.95rem;
  }
  
  .member-count {
    font-size: 0.8rem;
    text-align: right;
    max-width: 90px;
  }
  
  .post-title {
    font-size: 0.85rem;
  }
  
  .post-meta {
    font-size: 0.75rem;
  }
  
  .tab {
    padding: 10px;
    font-size: 0.8rem;
  }
  
  .join-community-tab {
    margin-top: 2.25rem !important;
    font-size: 0.9rem;
  }
}

/* Tablet Portrait (Normal) | 601px - 1024px */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: portrait) {
  .main-container {
    padding: 3rem 2rem;
  }
  
  .community-title {
    font-size: 2.25rem !important;
    margin: 0 0 3rem 0 !important;
  }
  
  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 1.75rem;
    max-width: 26.25rem;
  }
  
  .discord-widget {
    height: 500px;
  }
  
  .reddit-widget {
    height: 550px;
  }
  
  .widget-header {
    padding: 1.25rem;
  }
  
  .subreddit-name {
    font-size: 1.05rem;
  }
  
  .member-count {
    font-size: 0.9rem;
  }
  
  .post-title {
    font-size: 0.95rem;
  }
  
  .post-meta {
    font-size: 0.8rem;
  }
  
  .tab {
    padding: 12px;
    font-size: 0.85rem;
  }
  
  .join-community-tab {
    margin-top: 2.75rem !important;
    font-size: 1rem;
  }
}

/* Tablet Landscape (Seitlich gehlaten) | 951px - 1366px */
@media (min-width: 951px) and (max-width: 1366px) and (orientation: landscape) {
  .main-container {
    padding: 2.5rem 6rem;
  }
  
  .community-title {
    font-size: 2rem !important;
    margin: 0 0 2.25rem 0 !important;
  }
  
  .widgets-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
    max-width: 46.875rem;
  }
  
  .discord-widget {
    height: 475px;
  }
  
  .reddit-widget {
    height: 475px;
  }
  
  .widget-header {
    padding: 1.125rem;
  }
  
  .subreddit-name {
    font-size: 0.95rem;
  }
  
  .member-count {
    font-size: 0.75rem;
    text-align: right;
  }
  
  .post-title {
    font-size: 0.9rem;
  }
  
  .post-meta {
    font-size: 0.75rem;
  }
  
  .tab {
    padding: 10px;
    font-size: 0.8rem;
  }
  
  .join-community-tab {
    margin-top: 2.25rem !important;
    font-size: 0.95rem;
  }
}