/* General styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  font-family: Arial, sans-serif;
}

/* Layout */
#container {
  display: flex;
  flex-direction: column;
}

@media(min-width: 768px) {
  #container {
    flex-direction: row;
  }
}

/* Authentication styles */
#loginForm, #registerForm {
  max-width: 300px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ccc;
}

.auth-container {
  display: none;
}

.auth-container.active {
  display: block;
}

/* Project styles */
#editor-container, #projects-container {
  display: none;
}

.project-card {
  border: 1px solid #ddd;
  padding: 20px;
  margin: 15px 0;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.project-header {
  margin-bottom: 15px;
}

.project-header h3 {
  margin: 0 0 5px 0;
  color: #333;
}

.project-owner {
  color: #666;
  font-size: 0.9em;
}

.owner-email {
  color: #888;
}

.collaborators-section {
  margin: 15px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.collaborators-section h4 {
  margin: 0 0 10px 0;
  color: #555;
}

.collaborators-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.collaborators-list li {
  padding: 5px 0;
  color: #666;
}

.notepad-list {
  margin-left: 20px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  position: relative;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}

.close:hover {
  color: #000;
}

/* Fix scrollbar issue */
body.modal-open {
  overflow: hidden;
}

/* Button styles */
.button {
  padding: 8px 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 5px;
}

.button:hover {
  background-color: #45a049;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.logout-button {
  background-color: #dc3545;
}

.logout-button:hover {
  background-color: #c82333;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  font-size: 1.2em;
  color: #666;
}

.error-message {
  padding: 20px;
  background-color: #fff3f3;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
  border-radius: 4px;
  margin: 20px 0;
}

.project-title {
    flex: 1;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.collaborator-count {
    color: #4CAF50;
}

.collaborators-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.collaborators-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 0.95em;
}

.collaborators-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.collaborators-list li {
    display: flex;
    align-items: center;
    padding: 5px 0;
    gap: 8px;
}

.collaborator-name {
    color: #495057;
    font-weight: 500;
}

.collaborator-email {
    color: #6c757d;
    font-size: 0.9em;
}

.no-collaborators {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

.project-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.remote-cursor {
    width: 2px;
    height: 1.2em;
    display: inline-block;
    position: relative;
    animation: blink 1s infinite;
}

.remote-cursor::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid currentColor;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* User Business Card Styles */
.user-card {
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.user-avatar, .business-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    overflow: hidden;
}

.user-avatar.has-photo, .business-card-avatar.has-photo {
    background-color: transparent;
    padding: 0;
}

.user-avatar img.profile-photo, .business-card-avatar img.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-role {
    font-size: 0.8em;
    padding: 3px 8px;
    background-color: #f0f0f0;
    border-radius: 12px;
    display: inline-block;
    margin-top: 4px;
}

.user-role.owner {
    background-color: #f9a825;
    color: #4a3500;
}

.user-role.collaborator {
    background-color: #b3e5fc;
    color: #01579b;
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
}

.stat-value {
    font-weight: 500;
}

/* Business Card Popup */
.user-business-card {
    position: absolute;
    top: 0;
    left: 100%;
    width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    transform: translateX(10px);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

/* For cards at the right edge of the screen */
@media (min-width: 992px) {
    .user-card:nth-child(3n) .user-business-card,
    .user-card:nth-child(3n-1) .user-business-card {
        left: auto;
        right: 100%;
        transform: translateX(-10px);
    }
    
    .user-card:nth-child(3n):hover .user-business-card,
    .user-card:nth-child(3n-1):hover .user-business-card {
        transform: translateX(-5px);
    }
}

.user-card:hover .user-business-card {
    opacity: 1;
    visibility: visible;
    transform: translateX(5px);
}

.business-card-content {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #fff 0%, #f9f9f9 100%);
}

.card-gradient-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    z-index: 1;
}

.business-card-content::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid white;
    filter: drop-shadow(-3px 0px 2px rgba(0,0,0,0.1));
    z-index: 10;
}

/* For cards at the right edge of the screen */
@media (min-width: 992px) {
    .user-card:nth-child(3n) .business-card-content::before,
    .user-card:nth-child(3n-1) .business-card-content::before {
        left: auto;
        right: -10px;
        border-right: none;
        border-left: 10px solid white;
        filter: drop-shadow(3px 0px 2px rgba(0,0,0,0.1));
    }
}

.business-card-layout {
    display: flex;
    padding: 20px;
    padding-top: 25px;
}

.business-card-photo {
    flex-shrink: 0;
    margin-right: 25px;
}

.business-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 32px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    border: 3px solid white;
}

.business-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.business-card-name {
    margin: 0 0 5px 0;
    font-size: 26px;
    color: #333;
    font-family: 'Georgia', serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.business-card-title {
    margin: 5px 0 15px 0;
    font-size: 16px;
    color: #4CAF50;
    font-weight: bold;
    background-color: rgba(76, 175, 80, 0.08);
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
}

.business-card-contact {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.business-card-contact p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #555;
    position: relative;
    padding-left: 24px;
    display: flex;
    align-items: center;
}

.card-icon {
    width: 16px;
    height: 16px;
    position: absolute;
    left: 0;
    top: 3px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.email-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 512 512'%3E%3Cpath fill='%23666666' d='M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48H48zM0 176V384c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V176L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z'/%3E%3C/svg%3E");
}

.phone-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 512 512'%3E%3Cpath fill='%23666666' d='M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z'/%3E%3C/svg%3E");
}

.institute-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 512 512'%3E%3Cpath fill='%23666666' d='M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160v8c0 13.3 10.7 24 24 24H456c13.3 0 24-10.7 24-24v-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224H64V420.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512H480c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1V224H384V416H344V224H280V416H232V224H168V416H128V224z'/%3E%3C/svg%3E");
}

.location-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='16' width='16' viewBox='0 0 384 512'%3E%3Cpath fill='%23666666' d='M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z'/%3E%3C/svg%3E");
} 