@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background: #F6FCFA;
    margin: 0;
    padding: 0;
    color: #2A3037;
}

.container {
    max-width: 700px;
    margin: 48px auto;
    padding: 0 16px;
}

.profile-card,
.feature-card,
#expense-card,
#add-friend-card,
#view-friends-card,
#settle-up-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(82,196,161,0.08);
    padding: 36px 32px;
    color: #2A3037;
    margin-bottom: 32px;
}

h1, h2 {
    font-weight: 700;
    color: #2A3037;
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: -1px;
}

h1 .accent, h2 .accent, .btn-accent {
    color: #52C4A1;
}

p, label, .feature-desc {
    color: #5A6473;
    font-size: 1.08rem;
    font-weight: 400;
    margin-bottom: 18px;
}

label {
    font-weight: 600;
    color: #2A3037;
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    border: 1px solid #E3E8EF;
    background: #F6FCFA;
    color: #2A3037;
    font-size: 1rem;
    margin-bottom: 22px;
    font-family: inherit;
}

.btn, .btn-accent {
    background: #52C4A1;
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.08rem;
    line-height: 38px;
    transition: background 0.2s;
    margin: 0 6px;
    text-decoration: none;
    display: inline-block;
    min-width: 110px;
}

.btn:hover, .btn-accent:hover {
    background: #3bbd97;
}

.message {
    background: #E3F8F3;
    color: #2A3037;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #52C4A1;
}

.feature-row {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 32px;
    margin-bottom: 32px;
}

.feature-card {
    flex: 1;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(82,196,161,0.08);
    padding: 24px 18px;
    text-align: left;
    min-width: 200px;
}

.feature-icon {
    font-size: 2.2rem;
    color: #52C4A1;
    margin-bottom: 12px;
    display: block;
}

.feature-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: #2A3037;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 1rem;
    color: #5A6473;
    margin-bottom: 0;
}

.site-footer {
  margin-top: 2rem;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #333;
  border-top: 1px solid #e2e2e2;
}
.site-footer a {
  color: #007bff;
  text-decoration: underline;
}

.btn-inline-flex {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:38px;
  line-height:1.2;
  padding:0 16px;
  text-decoration:none;
}
/* Mobile tweak */
@media (max-width:600px){
  .btn-inline-flex {
    height:42px;
    font-size:0.9rem;
    padding:0 14px;
  }
}

.signup-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:38px;          /* ensures consistent button height */
  line-height:1.2;       /* avoid stretching text */
  padding:0 16px;
}
@media (max-width:600px){
  .signup-btn {
    height:42px;
    font-size:0.9rem;
  }
}

@media (max-width: 800px) {
    .feature-row {
        flex-direction: column;
        gap: 18px;
    }
    .container {
        max-width: 98vw;
        padding: 0 8px;
    }
}

/* Friends List grid overflow handling */
#friends-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.friend-card {
  background:#1e2a3a;
  border-radius:10px;
  padding:16px;
  box-shadow:0 2px 8px rgba(33,150,243,0.08);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-width:0;           /* allow shrinking inside grid */
  overflow:hidden;       /* contain long content */
}

.friend-card .friend-name {
  font-weight:600;
  color:#e0e7ef;
  margin-bottom:6px;
  font-size:0.95rem;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.friend-card .friend-email {
  font-size:0.85rem;        /* was 0.78rem */
  color:#b0bec5;
  margin-bottom:8px;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.friend-card .balance-line {
  font-size:0.7rem;
  line-height:1.25;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media (max-width:600px){
  #friends-list-grid { grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
  .friend-card { padding:12px; }
  .friend-card .friend-name { font-size:0.85rem; }
  .friend-card .friend-email {
    font-size:0.82rem;      /* slightly larger than before on mobile too */
    white-space:normal;
    overflow:visible;
    text-overflow:unset;
    word-break:break-word;
  }
  .friend-card .balance-line {
    white-space:normal;
    overflow:visible;
    text-overflow:unset;
    word-break:break-word;
  }
}

.form-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:18px;
}
.form-actions .btn-inline-flex{
  min-width:110px;
  padding:0 18px;
  height:38px;
}
@media (max-width:600px){
  .form-actions .btn-inline-flex{
    width:100%;
    min-width:0;
    height:42px;
    font-size:0.9rem;
  }
}

/* Friend Card Clickability Cues */
.friend-card-btn {
  position: relative; /* Needed to position the icon inside */
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  width: 100%;
  border: 1px solid transparent; /* Add border for consistent sizing */
}

.friend-card-btn:hover {
  background-color: #45617e; /* A more subtle, harmonious hover color */
  border-color: #4a5b6d;
}

.friend-card-action-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  color: #b0bec5; /* Lighter color for high contrast on dark background */
  opacity: 1; /* Fully visible, no transparency */
  font-size: 24px; /* Larger and easier to see */
  transition: transform 0.2s ease-in-out;
  line-height: 1; /* Ensures icon doesn't add extra vertical space */
}

/* Add a subtle movement on hover for desktop users */
.friend-card-btn:hover .friend-card-action-icon {
  transform: translateX(3px);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100%; height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.4);
}
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%; max-width: 400px;
  position: relative;
}
.close {
  position: absolute; right: 16px; top: 8px;
  font-size: 28px; font-weight: bold;
  color: #333; cursor: pointer;
}

/* Google-style Activity Log in Modal */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid #e0e0e0; /* Google's standard divider color */
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon-container {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

.activity-icon-container.expense-icon {
  background-color: #e8f0fe; /* Light blue for expenses */
  color: #1967d2;
}

.activity-icon-container.settle-icon {
  background-color: #e6f4ea; /* Light green for settlements */
  color: #188038;
}

.activity-icon-container.friendship-icon {
  background-color: #f1f3f4; /* Neutral gray for friendship */
  color: #5f6368;
}

.activity-details {
  flex-grow: 1;
}

.activity-description {
  font-size: 15px; /* Increased from 14px */
  color: #202124; /* Google's primary text color */
  line-height: 1.4;
}

.activity-meta {
  font-size: 13px; /* Increased from 12px */
  color: #5f6368; /* Google's secondary text color */
  margin-top: 4px;
}

/* Pagination Styles for Modal */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 8px;
  border-top: 1px solid #e0e0e0;
}

.pagination-btn {
  background-color: #1a73e8;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.pagination-btn:disabled {
  background-color: #f1f3f4;
  color: #9e9e9e;
  cursor: not-allowed;
}

.pagination-indicator {
  font-size: 14px;
  color: #5f6368;
}