/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
    color: #2c3e50;
}

/* Override for welcome page - must come after general body rule to prevent background shorthand from resetting background-image */
body.welcome-page {
    background-color: #2c3e50 !important;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3)), url('welcome-bg.jpg') !important;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2rem;
}

.login-header h1 i {
    color: #3F7085;
    margin-right: 10px;
}

.login-header p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
}

/* PIN Login Styles */
.pin-login-form {
    text-align: left;
}

.pin-login-form .form-group input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
}

.attempts-remaining {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

.attempts-remaining.error {
    color: #e74c3c;
    font-weight: 600;
}

/* Lockout Message */
.lockout-message {
    text-align: center;
    padding: 20px;
}

.lockout-message i {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.lockout-message h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.lockout-message p {
    color: #7f8c8d;
    font-size: 1rem;
    line-height: 1.5;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #3F7085;
    color: white;
}

.btn-primary:hover {
    background: #2d5a6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(63, 112, 133, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-brand h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.nav-brand h2 i {
    color: #3F7085;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.nav-btn.active {
    background: #3F7085;
    color: white;
}

.nav-btn.settings {
    color: #f39c12;
}

.nav-btn.settings:hover {
    background: #fdf2f2;
}

.nav-btn.logout {
    color: #e74c3c;
}

.nav-btn.logout:hover {
    background: #fdf2f2;
}

/* Page Content */
.page-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: calc(100vh - 70px);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.section {
    scroll-margin-top: 90px; /* Account for sticky header */
}

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

.page-header h2 {
    color: #3F7085;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2 i {
    color: #3F7085;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-actions-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filters Container */
.filters-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 12px 16px 12px 45px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    width: 300px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    width: 350px;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #7f8c8d;
    font-size: 16px;
    pointer-events: none;
}

/* Filter Controls */
.filter-group,
.sort-group {
    display: flex;
    align-items: center;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #3F7085;
    box-shadow: 0 0 0 3px rgba(63, 112, 133, 0.1);
}

.filter-select:hover {
    border-color: #3F7085;
}

/* Content Lists */
.content-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* Events List - Horizontal Layout */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.events-list .event-card {
    width: 100%;
    max-width: none;
}

/* Members List - Collapsible Cards */
.members-list {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* Advertising List */
.advertising-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Ad Management List */
.ad-management-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* Ad Management Cards */
.ad-management-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.ad-management-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ad-management-card.status-active {
    border-left: 5px solid #27ae60;
}

.ad-management-card.status-waiting {
    border-left: 5px solid #f39c12;
}

.ad-management-card.status-done {
    border-left: 5px solid #95a5a6;
    opacity: 0.7;
}

.ad-management-card.status-done.hidden {
    display: none;
}

.ad-management-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ad-management-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ad-management-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.ad-management-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-management-status.status-active {
    background: #d5f4e6;
    color: #27ae60;
}

.ad-management-status.status-waiting {
    background: #fef5e7;
    color: #f39c12;
}

.ad-management-status.status-done {
    background: #ecf0f1;
    color: #95a5a6;
}

.ad-management-body {
    padding: 20px;
}

.ad-management-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ad-management-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ad-management-detail-row .label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
}

.ad-management-detail-row .value {
    color: #555;
    flex: 1;
}

.ad-management-actions {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.ad-management-ellipsis {
    position: relative;
    display: inline-block;
}

.ellipsis-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: #7f8c8d;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.ellipsis-btn:hover {
    background: #e1e8ed;
    color: #2c3e50;
}

.ellipsis-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 150px;
    display: none;
}

.ellipsis-menu.show {
    display: block;
}

.ellipsis-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
}

.ellipsis-menu-item:hover {
    background: #f8f9fa;
}

.ellipsis-menu-item.change-status {
    color: #f39c12;
}

.ellipsis-menu-item.edit {
    color: #3F7085;
}

.ellipsis-menu-item.delete {
    color: #e74c3c;
}

/* Rate Display */
.rate-display {
    font-weight: 600;
    color: #27ae60;
    font-size: 1.1rem;
}

.rate-display::before {
    content: 'R';
    margin-right: 4px;
}

/* Date Display */
.date-display {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Manager Display */
.manager-display {
    color: #3F7085;
    font-weight: 500;
}

/* Contact Display */
.contact-display {
    color: #667eea;
    font-weight: 500;
    word-break: break-all;
}

/* Responsive Ad Management */
@media (max-width: 768px) {
    .ad-management-list {
        grid-template-columns: 1fr;
    }
    
    .ad-management-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ad-management-title-section {
        width: 100%;
    }
    
    .ad-management-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .ad-management-detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .ad-management-detail-row .label {
        min-width: auto;
    }
}

/* Collapsible Member Cards */
.member-card.collapsible {
    transition: all 0.3s ease;
    overflow: hidden;
}

.member-card.collapsible .collapsible-content {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.member-card.collapsible:hover .collapsible-content {
    max-height: 1000px;
    opacity: 1;
}

.member-card.collapsible:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Advertising Cards */
.advertising-card {
    overflow: hidden;
}

.advertising-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.advertising-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.advertising-card:hover .advertising-image img {
    transform: scale(1.05);
}

.advertising-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Image Preview */
.image-preview {
    margin-top: 10px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* File Input Styling */
input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Color Input Styling */
.color-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

input[type="color"] {
    width: 60px;
    height: 48px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    background: none;
    padding: 0;
}

input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="color"]:hover {
    border-color: #3F7085;
}

#aColorHex {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

#aColorHex:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#aColorHex:invalid {
    border-color: #e74c3c;
}

#aColorHex:valid {
    border-color: #27ae60;
}

/* Custom Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0;
    padding: 8px 0;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
    flex-shrink: 0;
    display: inline-block;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #3F7085;
    border-color: #3F7085;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 7px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
    border-color: #3F7085;
}

.checkbox-text {
    font-size: 16px;
    line-height: 1.4;
}

/* Featured Badge */
.featured-badge {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.featured-badge i {
    font-size: 0.6rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dashboard-card .card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.dashboard-card h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

.dashboard-card p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
}

.dashboard-card .btn {
    margin-top: auto;
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
}

/* Event and Member Details */
.event-details,
.member-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-row .label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

.detail-row .value {
    color: #555;
    flex: 1;
}

.detail-row a {
    color: #667eea;
    text-decoration: none;
}

.detail-row a:hover {
    text-decoration: underline;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #3F7085;
    color: white;
}

.data-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e1e8ed;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Clickable member rows */
.member-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.member-row:hover {
    background-color: #e3f2fd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.member-row:active {
    transform: translateY(0);
    background-color: #bbdefb !important;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 15px 12px;
    vertical-align: top;
    color: #2c3e50;
}

.data-table td a {
    color: #3F7085;
    text-decoration: none;
}

.data-table td a:hover {
    text-decoration: underline;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.table-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: auto;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.table-actions .btn i {
    margin-right: 4px;
}

.table-actions .btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.table-actions .btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    transform: scale(1.05);
}

.table-actions .btn-white {
    background-color: white;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.table-actions .btn-white:hover {
    background-color: #e74c3c;
    color: white;
    transform: scale(1.05);
}

/* Responsive Table */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .filter-group,
    .sort-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
        min-width: auto;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .table-actions .btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Gallery Styles */
.gallery-stats {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    color: #3F7085;
}

.upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-progress {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #3F7085;
    width: 0%;
    transition: width 0.3s ease;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-actions {
    display: flex;
    gap: 10px;
}

.gallery-item-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.image-modal-body {
    text-align: center;
    padding: 20px;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
}

.image-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .upload-controls {
        justify-content: center;
    }
}

/* Empty and Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Table Empty and Error States */
.data-table td.empty-state,
.data-table td.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 1.1rem;
    font-style: italic;
    background: #f8f9fa;
}

.error-state {
    color: #e74c3c;
    background: #fdf2f2;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: #3F7085;
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.modal-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-form .form-group input,
.modal-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.modal-form .form-group input:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-form .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #3F7085;
    box-shadow: 0 0 0 3px rgba(63, 112, 133, 0.1);
}

.form-group select:hover {
    border-color: #3F7085;
}

/* PIN Info Styles */
.pin-info {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row .label {
    font-weight: 600;
    color: #2c3e50;
}

.info-row .value {
    color: #3F7085;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

/* Welcome page styles (appended) */
.fullpage-welcome {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important; /* Don't cover the body background */
    padding: 40px;
}

.welcome-inner {
    width: 100%;
    max-width: 720px;
    background: #fff;
    padding: 36px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.welcome-title {
    font-size: 2.25rem;
    margin: 0 0 8px;
}

.welcome-subtitle {
    color: #666;
    margin: 0 0 22px;
}

.welcome-form {
    margin-top: 8px;
    text-align: left;
}

.welcome-form .form-group {
    margin-bottom: 14px;
}

.btn-group-toggle {
    display: flex;
    gap: 10px;
}

.visit-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.visit-btn.active {
    background: #2b6cb0;
    color: #fff;
    border-color: #2b6cb0;
}

.autocomplete {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 40;
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.autocomplete-list li {
    padding: 8px 12px;
    cursor: pointer;
}

.autocomplete-list li:hover {
    background: #f3f6fb;
}

.form-actions {
    margin-top: 18px;
    text-align: right;
}

/* Sign-in modal styles moved to welcome page section below */

/* Welcome page - enhanced visuals and background */
body.welcome-page {
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Background image with overlay for better text readability */
    background-color: #2c3e50 !important; /* Fallback color */
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3)), url('welcome-bg.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    position: relative;
    /* Extra large cursor - 64x64 pixels */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1.5" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 8 8, auto;
}

body.welcome-page * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24"><path fill="%23000" stroke="%23fff" stroke-width="1.5" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 8 8, auto;
}

body.welcome-page button,
body.welcome-page input,
body.welcome-page a {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24"><path fill="%232563eb" stroke="%23fff" stroke-width="1.5" d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>') 8 8, pointer;
}

/* Container tweaks */
.fullpage-welcome {
    width: 100%;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important; /* Don't cover the body background */
}

/* Card - improved for older users with better contrast */
.welcome-inner {
    width: 100%;
    max-width: 1400px; /* Increased from 900px */
    background: rgba(255, 255, 255, 0.98);
    padding: 50px 60px; /* Increased horizontal padding */
    border-radius: 16px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
    text-align: left;
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

/* Heading - larger for better readability */
.welcome-title {
    font-size: 4rem;
    line-height: 1.2;
    margin: 0 0 12px;
    margin-bottom: 30px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
}

.welcome-subtitle {
    color: #333;
    margin: 0 0 32px;
    font-size: 2rem;
    margin-bottom: 50px;
    font-weight: 500;
    text-align: center;
}

/* User type selection buttons */
.user-type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
    opacity: 1;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    visibility: visible;
}

.user-type-selection.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.user-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    font-size: 3rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #2563eb, #1e40af);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    min-height: 180px;
}

.user-type-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
}

.user-type-btn:active {
    transform: translateY(-2px);
}

.user-type-btn i {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.95;
}

.user-type-btn span {
    display: block;
}

/* Returning user button - different color */
#returningUserBtn {
    background: linear-gradient(180deg, #059669, #047857);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

#returningUserBtn:hover {
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
    background: linear-gradient(180deg, #047857, #065f46);
}

/* Responsive styles for user type buttons */
@media (max-width: 1024px) {
    .welcome-inner {
        max-width: 95%;
        padding: 40px 30px;
    }
    
    .new-user-fields,
    .business-fields {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .user-type-selection {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .user-type-btn {
        min-height: 150px;
        padding: 30px 20px;
        font-size: 1.3rem;
    }
    
    .user-type-btn i {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .welcome-form .form-actions {
        flex-direction: column;
    }
    
    .welcome-form .btn.btn-secondary {
        width: 100%;
    }
    
    .welcome-inner {
        padding: 30px 20px;
    }
}

/* Form layout - improved spacing for older users */
.welcome-form {
    margin-top: 10px;
    display: grid;
    gap: 32px; /* Increased from 32px for more spacing between fields */
    opacity: 0;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    visibility: hidden;
}

.welcome-form.show {
    opacity: 1;
    visibility: visible;
}

/* New user fields - two column layout */
.new-user-fields {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    gap: 32px 40px; /* Vertical gap 32px, horizontal gap 40px */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    visibility: hidden;
}

.new-user-fields.show {
    opacity: 1;
    visibility: visible;
}

/* Returning user fields */
.returning-user-fields {
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    visibility: hidden;
}

.returning-user-fields.show {
    opacity: 1;
    visibility: visible;
}

/* Full width fields (visit type, business fields, form actions) */
.welcome-form .form-group.full-width,
.business-fields,
.form-actions {
    grid-column: 1 / -1; /* Span full width */
}

.welcome-form .form-group {
    margin: 0;
}

/* Labels - larger and bolder for better visibility */
.welcome-form .form-group label {
    display: block;
    margin-bottom: 10px; /* Increased from 14px */
    margin-top: 40px;
    font-size: 1.6rem; /* Increased from 1.15rem */
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.2px;
}

/* Inputs - larger for easier interaction */
.welcome-form input[type="text"],
.welcome-form input[type="email"],
.welcome-form input[type="tel"],
.welcome-form input[type="password"] {
    width: 100%;
    padding: 18px 24px; /* Increased from 18px 20px */
    font-size: 1.3rem; /* Increased from 1.1rem */
    border-radius: 12px;
    border: 2px solid #cbd5e0;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: border-color 200ms ease, box-shadow 200ms ease;
    box-sizing: border-box;
    color: #1a1a1a;
}

.welcome-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.welcome-form input::placeholder {
    color: #9ca3af;
    font-size: 1.2rem; /* Increased from 1rem */
}

/* Visit buttons - larger for easier clicking */
.btn-group-toggle {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 4px;
}

.visit-btn {
    padding: 20px 32px; /* Increased from 16px 28px */
    border-radius: 12px;
    border: 2px solid #3b82f6;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.6rem; /* Increased from 1.1rem */
    color: #1e40af;
    transition: all 200ms ease;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background: #eff6ff;
}

.visit-btn.active {
    background: linear-gradient(180deg, #2563eb, #1e40af);
    color: #fff;
    border-color: #1e40af;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

/* Business fields container */
.business-fields {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for business fields */
    gap: 32px 40px; /* Vertical gap 32px, horizontal gap 40px */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out, margin-top 0.3s ease-in-out;
}

.business-fields.show {
    opacity: 1;
    max-height: 500px;
}

/* Autocomplete list adjustments */
.autocomplete-list {
    max-height: 160px;
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 10px 30px rgba(2,6,23,0.12);
}

/* Sign-in button - larger and more prominent */
.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.welcome-form .btn.btn-primary {
    padding: 18px 36px;
    font-size: 1.6rem;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(180deg, #2563eb, #1e40af);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    transition: transform 200ms ease, box-shadow 200ms ease;
    min-width: 180px;
}

.welcome-form .btn.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
    background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
}

.welcome-form .btn.btn-primary:active {
    transform: translateY(-1px);
}

.welcome-form .btn.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.welcome-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.welcome-form .btn.btn-secondary {
    padding: 18px 24px;
    font-size: 1.6rem;
    font-weight: 600;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.welcome-form .btn.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.welcome-form .btn.btn-secondary:active {
    transform: translateY(0);
}

/* Modal - larger and centered with better readability */
.signin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 300ms ease;
}

.signin-modal.show {
    opacity: 1;
}

.signin-modal-inner {
    background: rgba(255, 255, 255, 0.99);
    padding: 60px 70px; /* Increased from 50px 60px */
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    max-width: 700px;
    width: 90%;
    position: relative;
}

.signin-modal.show .signin-modal-inner {
    opacity: 1;
}

/* Modal title styling - larger for older users */
.signin-modal h2, .signin-modal-inner h2 {
    font-size: 3rem; /* Increased from 2.2rem */
    margin: 0 0 24px; /* Increased from 16px */
    color: #1a1a1a;
    font-weight: 700;
    animation: titlePulse 2s ease-in-out infinite;
    position: relative;
}

.signin-modal-inner h2::before {
    content: '🎉';
    display: inline-block;
    margin-right: 12px;
    animation: bounce 1s ease-in-out infinite;
    font-size: 2.5rem;
}

.modal-celebration {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.modal-celebration span {
    display: inline-block;
    animation: bounce 1.5s ease-in-out infinite;
}

.modal-celebration span:nth-child(1) {
    animation-delay: 0s;
}

.modal-celebration span:nth-child(2) {
    animation-delay: 0.3s;
}

.modal-celebration span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.signin-modal-inner p {
    font-size: 1.5rem; /* Increased from 1.2rem */
    color: #4b5563;
    margin: 0;
    line-height: 1.8; /* Increased from 1.6 */
}

/* Autocomplete list - improved styling */
.autocomplete-list {
    max-height: 200px;
    border-radius: 10px;
    padding: 8px 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: #fff;
    border: 2px solid #e5e7eb;
}

.autocomplete-list li {
    padding: 14px 18px;
    cursor: pointer;
    font-size: 1.05rem;
    color: #1a1a1a;
    transition: background-color 150ms ease;
}

.autocomplete-list li:hover {
    background: #eff6ff;
}

/* Responsive - maintain large sizes for accessibility */
@media (max-width: 720px) {
    .welcome-inner {
        padding: 36px 28px;
        border-radius: 14px;
    }
    .welcome-title {
        font-size: 2.2rem;
    }
    .welcome-subtitle {
        font-size: 1.15rem;
    }
    .welcome-form .btn.btn-primary {
        width: 100%;
        padding: 16px 24px;
        font-size: 1.15rem;
    }
    .form-actions {
        justify-content: stretch;
    }
    .visit-btn {
        min-width: 130px;
        padding: 14px 20px;
        font-size: 1rem;
    }
    .signin-modal-inner {
        padding: 40px 30px;
        max-width: 90%;
    }
    .signin-modal h2, .signin-modal-inner h2 {
        font-size: 2.2rem; /* Adjusted for mobile */
    }
    .signin-modal-inner h2::before {
        font-size: 2rem;
    }
    .signin-modal-inner p {
        font-size: 1.2rem; /* Adjusted for mobile */
    }
}
