/* Common styles for Gift Platform */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Base layout and typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgb(246, 244, 251);
}

/* Header styles */
.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: bold;
    color: #333;
}

.user-email {
    font-size: 14px;
    color: #6c757d;
}

/* Main container */
.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 { 
    color: rgb(34, 31, 38); 
    margin-top: 0;
    font-weight: 600;
}

h1 {
    font-weight: 700;
}

p {
    color: rgb(128, 113, 142);
}

a {
    color: #8473d1;
}

a:hover {
    text-decoration: underline;
}

/* Navigation styles */
.nav-links {
    margin-bottom: 20px;
}

.nav-links a {
    color: #8473d1;
    text-decoration: none;
    margin-right: 15px;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: rgb(34, 31, 38);
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgb(212, 205, 228);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    background-color: rgb(246, 244, 251);
    color: rgb(38, 34, 42);
}

/* Fix date input sizing on mobile */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* Button styles */
button, .button {
    background-color: rgba(155, 135, 245, 0.99);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    margin-right: 10px;
}

button:hover, .button:hover {
    background-color: rgba(155, 135, 245, 0.8);
}

button.action, .button.action {
    background-color: #00c2a1;
    color: white;
}

button.action:hover, .button.action:hover {
    background-color: #00a085;
}

button.danger {
    background-color: rgb(255, 224, 234);
    color: #dc3545;
}

button.danger:hover {
    background-color: #dc3545;
    color: #eee;
}

button.large, .button.large {
    padding: 12px 24px;
    font-size: 16px;
}

/* Layout utilities */
.two-column {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.column {
    flex: 1;
}

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

.actions-header h2 {
    margin: 0;
    color: #333;
}

/* Card styles */
.gift-card, .recipient-card, .action-card, .stat-card {
    background-color: rgba(246, 244, 251, 0.5);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.gift-card h3 {
    margin-top: 0;
    color: #495057;
}

/* Message states */
.success {
    background-color: #f9e7d5;
    border: 1px solid #f0d0a0;
    color: #8b5a00;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

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

/* Table styles */
.recipients-table, .gifts-table, .occasion-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.recipients-table th,
.recipients-table td,
.gifts-table th,
.gifts-table td,
.occasion-table th,
.occasion-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.recipients-table th,
.gifts-table th,
.occasion-table th {
    background-color: rgba(246, 244, 251, 0.5);
    font-weight: bold;
    color: #495057;
}

.recipients-table tr:hover,
.gifts-table tr:hover,
.occasion-table tr:hover {
    background-color: #f5f5f5;
}

/* Filter sections */
.filter-section {
    background-color: rgba(246, 244, 251, 0.5);
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-section label {
    font-weight: bold;
    color: #555;
}

.filter-section select {
    background-color: #FFF;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Badge styles */
.days-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.days-urgent { 
    background-color: #f8d7da; 
    color: #721c24; 
}

.days-soon { 
    background-color: #fff3cd; 
    color: #856404; 
}

.days-upcoming { 
    background-color: #d1ecf1; 
    color: #0c5460; 
}

/* Spinner animation */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop/Mobile visibility classes */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

/* Mobile occasion cards */
.occasion-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.occasion-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.occasion-card .card-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.occasion-card .info-row {
    margin-bottom: 8px;
    color: #555;
}

.occasion-card .info-row strong {
    color: #333;
}

.occasion-card .card-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        max-width: 100%;
        padding: 10px;
    }
    
    .two-column {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .actions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Switch to mobile layout */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    /* Ensure date inputs are full size on mobile */
    input[type="date"] {
        min-height: 44px; /* iOS minimum touch target */
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile card button styling */
    .occasion-card .button {
        flex: 1;
        text-align: center;
        margin-right: 0;
    }
}

/* Anti-spam honeypot field - hidden from users, visible to bots */
.contact-info-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    tabindex: -1;
}
