/* Import trip card styles */
@import url('trip-card.css');

/* Success and Error Messages */
.success-message {
    background: #27ae60;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none;
}

/* Admin-only elements styling */
.admin-only {
    position: relative;
}

.admin-only::after {
    content: "🔒";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    background: #f39c12;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.menu-card.admin-only {
    border: 2px solid #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    color: #333; /* Dark text for visibility */
}

.menu-card.admin-only h3 {
    color: #2c3e50; /* Dark heading color */
}

.menu-card.admin-only p {
    color: #34495e; /* Dark paragraph color */
}

.menu-card.admin-only:hover {
    border-color: #e67e22;
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
    color: #2c3e50; /* Maintain dark text on hover */
}

.menu-card.admin-only:hover h3 {
    color: #2c3e50; /* Maintain dark heading on hover */
}

.menu-card.admin-only:hover p {
    color: #34495e; /* Maintain dark paragraph on hover */
}

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

/* Add New Trip Section */
.add-new-trip-section {
    margin-bottom: 20px;
    text-align: center;
}

.add-new-trip-section .btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-new-trip-section .btn:hover {
    background: #218838;
}

/* Saved Trip Card */
.saved-trip-card {
    margin-top: 20px;
}

/* Edit Modal Styles */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.edit-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

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

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: #e9ecef;
    color: #333;
}

.edit-modal form {
    padding: 30px;
}

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

.edit-modal-actions .btn {
    padding: 12px 24px;
    font-size: 14px;
}

.edit-modal-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.edit-modal-actions .btn-secondary:hover {
    background: #5a6268;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* Login Page Specific Styles */
#login-screen .content {
    max-width: 400px;
    margin: 0 auto;
}

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

.demo-credentials {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.demo-credentials h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.demo-credentials p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Dashboard Overview Styles */
.dashboard-overview {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.dashboard-overview h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

/* Analytics Styles */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.analytics-metric {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav button:hover, .nav button.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-link {
    display: inline-block;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.nav-link:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.main-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.menu-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.menu-card .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.menu-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.menu-card p {
    opacity: 0.9;
    line-height: 1.6;
}

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

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

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

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

/* Location input container styles (for country and state) */
.location-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.location-input-container input {
    flex: 1;
}

.detect-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 50px;
}

.detect-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
}

.detect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-help {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.btn:hover:not(:disabled):not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.btn.loading {
    cursor: wait;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s ease infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

.btn-secondary {
    background: #6c757d;
    margin-right: 10px;
    width: auto;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

.card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.house-church-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.house-church-leader {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid #e1e5e9;
}

.remove-leader {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.add-leader {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
}



.people-group-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.people-group-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.people-group-location {
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #e1e5e9;
}

.people-group-location small {
    color: #667eea;
    font-weight: 500;
}

.people-group-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.people-group-stat {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.milestone-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 15px;
}

.milestone-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.milestone-badge.pending {
    background: #ffc107;
}

.milestone-content h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.milestone-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #667eea;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #667eea;
}

.timeline-date {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-content h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.timeline-content p {
    margin: 0;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
    }
    
    .nav button {
        width: 100%;
    }
    
    .content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .main-menu {
        grid-template-columns: 1fr;
    }

    .menu-card {
        padding: 30px;
    }

    .location-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .detect-btn {
        width: 100%;
        margin-top: 5px;
    }
}

/* Table Styles for Daily Reports */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
}

.trips-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.trips-table th {
    background: #667eea;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid #5a67d8;
}

.trips-table td {
    padding: 12px;
    border-bottom: 1px solid #e1e5e9;
    font-size: 0.9rem;
    vertical-align: top;
}

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

.trips-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.trips-table tbody tr:nth-child(even):hover {
    background-color: #e9ecef;
}

.total-row {
    background: #667eea !important;
    color: white;
    font-weight: bold;
}

.total-row td {
    border-bottom: none;
    padding: 15px 12px;
}

.total-row:hover {
    background: #5a67d8 !important;
}

.summary-stats {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e1e5e9;
}

.summary-stats h4 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

/* Responsive table */
@media (max-width: 768px) {
    .trips-table {
        font-size: 0.8rem;
    }
    
    .trips-table th,
    .trips-table td {
        padding: 8px 6px;
    }
    
    .trips-table th {
        font-size: 0.8rem;
    }
}

/* Responsive Layout Control */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

/* Mobile-Friendly Daily Report Styles */
.daily-report-container {
    padding: 0;
    margin: 0;
}

.daily-report-container h3 {
    text-align: center;
    margin: 20px 0;
    color: #2d3748;
    font-size: 1.5rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 12px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-number {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 4px;
    line-height: 1;
}

.summary-label {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.2;
}

/* Trip Cards Container */
.trip-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 4px;
}

/* Individual Trip Report Cards */
.trip-report-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.trip-report-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.trip-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.trip-number {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Location Section */
.trip-location {
    margin-bottom: 16px;
}

.location-main {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 2px;
}

.location-details {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.location-city {
    color: #4a5568;
    font-size: 0.85rem;
    font-style: italic;
}

/* Stats Section */
.trip-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-item {
    flex: 1;
    min-width: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.stat-item.full-width {
    flex: 1 1 100%;
}

.stat-label {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

.stat-value {
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 600;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .summary-card {
        padding: 12px 8px;
    }
    
    .summary-number {
        font-size: 1.5rem;
    }
    
    .summary-label {
        font-size: 0.7rem;
    }
    
    .trip-report-card {
        padding: 12px;
        margin: 0 -4px;
    }
    
    .trip-header h4 {
        font-size: 1rem;
    }
    
    .stat-row {
        flex-direction: column;
        gap: 6px;
    }
    
    .stat-item {
        min-width: auto;
        padding: 6px 10px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 0.85rem;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .summary-card {
        padding: 10px 6px;
    }
    
    .summary-number {
        font-size: 1.3rem;
    }
    
    .summary-label {
        font-size: 0.65rem;
    }
    
    .trip-report-card {
        padding: 10px;
    }
    
    .trip-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .trip-number {
        align-self: flex-end;
    }
}