/* Friends Grid Layout */
.friends-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.friends-section {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 8px;
}

.full-width {
    grid-column: span 2;
}

.request-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Neon Borders */
.neon-border {
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 10px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* List Items */
#friends-list li,
#received-requests-list li,
#sent-requests-list li,
#users-list li {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    margin: 5px 10px 5px 0;
    background: #404040;
    border-radius: 20px;
    transition: all 0.3s ease;
    width: fit-content;
}

/* Image Metadata Styles */
.image-meta-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #2d2d2d;
    border-radius: 8px;
}

.image-meta-section h3 {
    margin-bottom: 10px;
    color: #00ff00;
    border-bottom: 1px solid #404040;
    padding-bottom: 5px;
}

.rating-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.average-rating, .rate-image {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star.active {
    color: #ffd700;
}

.star:hover {
    color: #ffd700;
}

.rating-stars {
    font-weight: bold;
    color: #ffd700;
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.comment-item {
    background: #404040;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.comment-time {
    color: #888;
    font-size: 0.8em;
}

.comment-text {
    color: #ccc;
}

.no-comments, .no-categories {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.add-comment textarea {
    width: 100%;
    background: #404040;
    border: 1px solid #666;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    resize: vertical;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.category-tag {
    background: #00ff00;
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.add-category {
    display: flex;
    gap: 10px;
    align-items: center;
}

.add-category select {
    flex: 1;
    background: #404040;
    border: 1px solid #666;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
}

.btn-primary {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary:hover {
    background: #00cc00;
}

#friends-list li:hover,
#received-requests-list li:hover,
#sent-requests-list li:hover,
#users-list li:hover {
    background: #505050;
    transform: translateX(5px);
}

/* User Icon Styles */
.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
    color: white;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    box-shadow: 0 0 8px currentColor;
    transition: all 0.3s ease;
}

.username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Scrollbar for neon-border lists */
.neon-border::-webkit-scrollbar {
    width: 8px;
}

.neon-border::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.neon-border::-webkit-scrollbar-thumb:hover {
    background: #90ee90;
}

/* Add background color from profile */
body {
    background-color: #343a40;
    position: relative;
    margin: 15px; /* Increased from 5px */
    min-height: calc(100vh - 30px); /* Account for new margin */
    padding: 20px; /* Add internal padding */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Lazy loading styles */
img[data-src] {
    background: #f0f0f0;
    min-height: 200px;
}

/* Create page border with shadow effect */
body::before {
    content: '';
    position: fixed;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 5px solid #606060; /* Lighter gray */
    box-shadow: 0 0 20px rgba(0,0,0,0.3), 
                inset 0 0 15px rgba(0,0,0,0.1);
    pointer-events: none; /* Allow clicks through */
    z-index: 9999; /* Ensure it stays on top */
}

/* Tab Container */
.tab-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

/* Tab Buttons */
.tab-button {
    background-color: #404040;
    color: white;
    border: 2px solid #00ff00;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.tab-button:hover {
    background-color: #505050;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.tab-button.active {
    background-color: #00ff00;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
}

.tab-content {
    display: none;
    view-transition-name: tab-content;
}

.tab-content.active {
    display: block;
}

/* View Transition Animations for Tabs */
::view-transition-old(tab-content),
::view-transition-new(tab-content) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(tab-content) {
    animation-name: fade-out;
}

::view-transition-new(tab-content) {
    animation-name: fade-in;
}

@keyframes fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* View Transition Animations */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
  animation-timing-function: ease-in-out;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation-name: fade-out;
}

::view-transition-new(root) {
  animation-name: fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Make the username header white */
h1 {
    color: #fff !important;
}

/* Force white text in content sections */
.content-section.dark-theme,
.content-section.dark-theme h1,
.content-section.dark-theme h2,
.content-section.dark-theme h3,
.content-section.dark-theme h4,
.content-section.dark-theme p {
    color: #fff !important;
}

/* Force white text in friends-section */
.friends-section.dark-theme,
.friends-section.dark-theme h1,
.friends-section.dark-theme h2,
.friends-section.dark-theme h3,
.friends-section.dark-theme h4,
.friends-section.dark-theme p {
    color: #fff !important;
}

/* Company block text overrides */
.company-block h4 {
    color: #fff !important;
}

.company-block p {
    color: #fff !important;
}

/* List items */
.list-unstyled li {
    color: #fff !important;
}

/* New card styling matching profile */
.content-section.dark-theme {
    background-color: #404040 !important;
    color: #fff;
    border: 2px solid #00ff00;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 96%;
    margin: 0 auto;
    /* margin-bottom: 20px; */
}

/* Grid layout for collaboration section */
.collab-section .d-flex {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Company block styling */
.company-block {
    padding: 1.5rem;
    background: #505050 !important;
    border: 1px solid #00ff00;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.company-block:hover {
    transform: translateY(-5px);
}

/* Neon scrollbars to match profile */
::-webkit-scrollbar {
    width: 10px;
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #90ee90;
}

.title {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

/* Custom styles for the navigation bar */
.navbar {
    background-color: #404040; /* Darker grey to match theme */
    border-radius: 10px;
    border-bottom: 1px solid #2d2d2d;
    text-align: right;
}

.navbar-brand {
    color: #fff !important; /* White text */
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.nav-link {
    color: #fff !important; /* White text */
    margin-right: 15px;
    border-radius: 10px;
    border: 1px solid #00ff00; /* Neon green border */
    display: inline-block;
}

.nav-link:hover {
    color: #90ee90 !important; /* Light green hover */
    border-color: #90ee90;
}

.navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1); /* Light border for toggler */
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.list-unstyled {
    text-align: center;
    padding-left: 0;  /* Remove default list padding */
}

/* Checkmark styling */
.checkmark {
    color: #00ff00;
    font-weight: bold;
    margin-right: 5px;
}

/* Upload Results Modal Styles */
#uploadResultsModal .modal-content {
    background: #2d2d2d;
    color: #fff;
    padding: 25px;
    border-radius: 10px;
}

.upload-results-section {
    margin: 15px 0;
}

.success-header {
    color: #00ff00;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 5px;
}

.error-header {
    color: #ff4444;
    border-bottom: 2px solid #ff4444;
    padding-bottom: 5px;
}

.success-list, .error-list {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.success-list li {
    color: #90ee90;
    padding: 5px;
    border-left: 3px solid #00ff00;
    margin: 5px 0;
}

.error-list li {
    color: #ff8888;
    padding: 5px;
    border-left: 3px solid #ff4444;
    margin: 5px 0;
}

#retryFailedButton {
    width: 100%;
    background: #ff9900;
    border: none;
    transition: all 0.3s ease;
}

#retryFailedButton:hover {
    background: #ffaa33;
    transform: scale(1.02);
}

/* View Transition for modals */
::view-transition-old(modal),
::view-transition-new(modal) {
  animation-duration: 0.3s;
  mix-blend-mode: normal;
}

.modal-content {
  view-transition-name: modal;
}

/* Friend list transitions */
.friend-item {
  view-transition-name: var(--vt-friend-name);
  contain: layout;
}

::view-transition-group(friend) {
  animation-duration: 0.3s;
  animation-timing-function: ease-in-out;
}

/* Default modal state */
.modal {
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 20000 !important;
}

/* Modal background overlay */
.modal::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 19999;
}

/* Ensure modal content appears above overlay */
.modal-content {
  z-index: 20001;
  position: relative;
}

/* Lower z-index for competing elements */
.timeline-editor, #new-timeline-container {
  z-index: 1000 !important;
}

/* Visible modal state */
.modal.visible {
  opacity: 1;
  visibility: visible;
}

/* Ensure save button stays visible */
.btn-save-timeline {
    display: none;
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    opacity: 1;
    pointer-events: all;
    transition: all 0.3s ease;
}

.timeline-editor {
    position: relative; /* Add this for absolute positioning context */
}

.btn-save-timeline.pulsing {
    animation: save-pulse 1s infinite;
}

@keyframes save-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Add spacing to timeline container */
.timeline-editor {
    padding-bottom: 40px !important; /* Make space for button */
    overflow: visible !important;
}

/* Timeline title positioning */
.timeline-editor h3 {
    margin-bottom: 30px; /* Create space below title */
    position: relative;
    z-index: 1; /* Keep above time ticks */
}

.time-ticks {
    top: 25px; /* Adjust tick position */
}

/* Custom styles for the image galleries */
.upload-container {
    margin-top: 20px;
    text-align: center;
    -webkit-text-fill-color: antiquewhite;
    background-color:#343a40;
    max-width: calc(100% - 40px); /* Account for body padding + margin */
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.image-gallery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    position: relative;
    z-index: 1;
}

.image-gallery, .shared-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #404040;
    height: 60vh; /* Reduced from 90vh */
    min-height: 400px; /* Add minimum height */
    overflow-y: auto;
}

.gallery-title {
    grid-column: 1 / -1;
    color: #fff;
    margin-bottom: 1rem;
}

.image-item {
    position: relative;
    overflow: visible; /* Changed from hidden */
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #1a1a1a;
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.image-item:hover img {
    transform: rotate(360deg) scale(2.5) translateZ(0);
    z-index: 1000;
    position: relative;
    box-shadow: 0 0 25px rgba(0,255,0,0.5);
    border: 2px solid #00ff00 !important;
}

/* Scrollbar styling */
.image-gallery::-webkit-scrollbar,
.shared-image-gallery::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.image-gallery::-webkit-scrollbar-track,
.shared-image-gallery::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.image-gallery::-webkit-scrollbar-thumb,
.shared-image-gallery::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.image-gallery::-webkit-scrollbar-thumb:hover,
.shared-image-gallery::-webkit-scrollbar-thumb:hover {
    background: #90ee90;
}

.hero-image {
  border-color: rgb(0, 255, 0);
  border-style: solid;
  border-width: 2px;
  border-radius: 8px;
} 

.image-item {
    border: 1px solid #ddd;
    padding: 2px;
    background-color: #f9f9f9;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    view-transition-name: var(--vt-name);
    contain: layout; /* Optimize for transitions */
}

.image-item img {
    max-width: 100%;
    border-radius: 2px;
    transition: transform 0.3s ease-in-out; /* Smooth transition */  
}

.image-item img:hover {                                                                                                                                      
    transform: rotate(360deg) scale(2.2); /* Rotate and scale on hover */ 
    border: 1px solid #ddd;
    padding: 2px;
    background-color: #f9f9f9;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);                                                                                   
}

.timeline-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    height: auto;
    overflow-y: visible;
    padding-bottom: 20px;
}

.timeline-item {
    max-width: 100%;
    border-radius: 2px;
}

/* Discovered devices header animation */
.discovered-devices-header {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Spinner visibility fixes */
#profile-spinner.hidden {
    display: none !important;
}
