/* General Styles */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");

* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #d9d9d9;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #007b5e;
}

a:hover {
    color: #005a3c;
}

/* Alerts */
.alert {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}
.alert-success { background-color: #d4edda; color: #155724; }
.alert-danger { background-color: #f8d7da; color: #721c24; }
.alert-info { background-color: #d1ecf1; color: #0c5460; }

/* Toolbar Styles */
.toolbar {
    background: #00b0b0;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}

.toolbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-brand p {
    margin: 8px 0px 0px 0px;
}

.toolbar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar a {
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    font-size: 16px;
    white-space: nowrap;
}

.toolbar a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    text-decoration: none;
}

.toolbar a.active {
    background: rgba(255, 255, 255, 0.3);
}

.toolbar .logout-btn {
    background: #ff5e5a;
    padding: 10px 18px;  /* Increased padding */
    border-radius: 6px;
    font-weight: 600;
}

.toolbar .logout-btn:hover {
    background: #ff4743;
    transform: translateY(-2px);
}

.content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url("/static/oneslice-gray.png");
  background-size: 648px 450px;
  background-position: center;
  background-repeat: repeat;
  padding: 20px;
}

.general-card {
  background: #f1fbfa;
  padding: 20px;
  border: 8px solid #00b0b0;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  align-self: start;
  width: 100%;
  max-width: 1200px;
  min-height: auto;
  overflow-x: auto;
}

.general-card h1 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
  font-size: 24px;
}

/* Dashboard Styles */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    background: #f1fbfa;
    border: 8px solid #00b0b0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    align-self: start;
    min-height: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.header h1 {
    margin-top: 0px;
    margin-bottom: 10px;
    font-size: 24px;
}

.header p {
    margin: 0px;
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-self: flex-start;
    flex-wrap: wrap;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.group-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.group-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.group-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.group-stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    justify-content: space-around;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #60b886;
}

.stat-number.needs-attention {
    color: #ff5e5a;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.group-info {
    margin: 15px 0;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
    word-break: break-all;
}

.group-info code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #16cbc9;
}

.group-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-view, .btn-list {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-view {
    background: #60b886;
    color: white;
}

.btn-view:hover {
    background: #4da573;
}

.btn-list {
    background: #16cbc9;
    color: white;
}

.btn-list:hover {
    background: #13b3b1;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Group Detail Styles */
.group-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.member-section {
    margin-bottom: 40px;
}

.badge-success {
    background: #60b886;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-claimed {
    background: #ffd136;
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-available {
    background: #a3d6d2;
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.btn-small {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-claim {
    background: #60b886;
    color: white;
}

.btn-claim:hover {
    background: #4da573;
}

.btn-unclaim {
    background: #ff5e5a;
    color: white;
}

.btn-unclaim:hover {
    background: #ff4743;
}

.text-muted {
    color: #999;
    font-style: italic;
}

/* Login and Registration */
.auth-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
}

.auth-card h2, .auth-card h1 {
  margin-top: 0;
  margin-bottom: 30px;
  text-align: center;
  color: #333;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
  box-sizing: border-box;
  font-family: Nunito, sans-serif;
}

.form-group input:focus {
  outline: none;
  border-color: #3ec3d1;
}

.add-gift-section {
    margin-top: 30px;
}

.btn-add-gift {
    padding: 12px 24px;
    background: #60b886;
    color: white;
    border: none;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-add-gift:hover {
    background: #4da573;
    transform: translateY(-2px);
}

.btn-delete-gift {
    padding: 8px 16px;
    background: #007b5e;
    color: white;
    border: none;
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.add-gift-form {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.add-gift-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
  padding: 12px 20px;
  background: #83dbe4;
  color: white;
  border: none;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
  text-align: center;
  font: inherit;
}

.btn-primary:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  padding: 12px 20px;
  background: #ffd136;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
  text-align: center;
  margin-left: 10px;
}

.btn-secondary:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}

.auth-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* User Section */
.user-section {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.user-section h3 {
    color: #8b0000;
}

.user-section p {
    margin: 10px 0;
}

/* Buttons */
button {
    background-color: #007b5e;
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1.6;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    overflow-x: auto;
    display: block;
}

table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}

table tbody {
    display: table;
    width: 100%;
    table-layout: fixed;
}

table th, table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    word-wrap: break-word;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Claimed Gifts */
.claimed {
    color: gray;
    text-decoration: line-through;
}

/* Footer */
.footer {
    text-align: center;
    margin: 20px 0;
    color: #555;
}

/* Flash Messages */
.flash-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.alert {
    padding: 15px 40px 15px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* Gift Exchange Styles */
.gift-exchange-banner {
    background: #16cbc9;
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.gift-exchange-banner h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 28px;
}

.exchange-assignment {
    font-size: 20px;
    margin: 15px 0;
}

.exchange-assignment strong {
    font-size: 24px;
    text-decoration: underline;
}

.exchange-hint {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 10px;
}

.gift-exchange-setup {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px dashed #60b886;
}

.gift-exchange-setup h3 {
    margin-top: 0;
    color: #333;
}

.gift-exchange-setup p {
    color: #666;
    margin-bottom: 15px;
}

.badge-exchange {
    background: #ffd136;
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .toolbar {
        padding: 12px 15px;
    }
    
    .toolbar-brand {
        font-size: 22px;  /* Adjusted for mobile */
    }
    
    .toolbar-nav {
        justify-content: center;
        margin-top: 10px;
    }
    
    .toolbar a {
        padding: 8px 14px;  /* Adjusted for mobile */
        font-size: 15px;  /* Adjusted for mobile */
    }
    
    .content {
        background-size: 200px 200px;
        padding: 10px;
    }
    
    .general-card {
        padding: 15px;
        border-width: 4px;
        margin-top: 10px;
    }
    
    .general-card h1 {
        font-size: 20px;
    }
    
    .dashboard-container {
        padding: 15px;
        border-width: 4px;
        margin-top: 10px;
        min-width: auto;
    }
    
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .header-actions a,
    .header-actions .btn-primary,
    .header-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .groups-grid {
        grid-template-columns: 1fr;
    }
    
    .group-card {
        padding: 15px;
    }
    
    .group-stats {
        gap: 15px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .group-actions {
        flex-direction: column;
    }
    
    .btn-view, .btn-list {
        width: 100%;
    }

    .btn-add-gift {
        width: 100%;
    }
    
    .group-header {
        flex-direction: column;
    }
    
    .group-header .group-actions {
        width: 100%;
    }
    
    .auth-card {
        padding: 20px;
        max-width: 100%;
    }
    
    .auth-card h1, .auth-card h2 {
        font-size: 20px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .add-gift-form {
        padding: 15px;
    }
    
    table {
        font-size: 14px;
    }
    
    table th, table td {
        padding: 8px;
    }
    
    /* Make table scrollable on mobile */
    .general-card {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    .general-card h1 {
        font-size: 18px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .group-card h3 {
        font-size: 18px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 6px;
    }
}

@media (max-width: 768px) {
    .gift-exchange-banner h2 {
        font-size: 22px;
    }
    
    .exchange-assignment {
        font-size: 18px;
    }
    
    .exchange-assignment strong {
        font-size: 20px;
    }
}