/* Custom styles for Erasmus Survival Kit */

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    a, button, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Active tab styling */
.common-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Mobile menu styling */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

#mobileMenu.hidden {
    animation: slideUp 0.3s ease-out;
}

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

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

/* Mobile navigation links */
@media (max-width: 768px) {
    #mobileMenu a {
        display: block;
        padding: 12px 16px;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    #mobileMenu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Card hover effects */
.document-card, .tip-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.document-card:hover, .tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Checklist item styling */
.checklist-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.checklist-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.checklist-item.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.checklist-item.completed .task-text {
    text-decoration: line-through;
    color: #6b7280;
}

/* Timeline styling */
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 3px #3b82f6;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 20px;
    width: 2px;
    height: calc(100% - 12px);
    background: #e5e7eb;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-item.completed::before {
    background: #10b981;
    box-shadow: 0 0 0 3px #10b981;
}

.timeline-item.upcoming::before {
    background: #f59e0b;
    box-shadow: 0 0 0 3px #f59e0b;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

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

/* Success message */
.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

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

/* Error message */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

/* Progress bar animation */
.progress-bar-animated {
    animation: progressAnimation 0.5s ease-out;
}

@keyframes progressAnimation {
    from { width: 0%; }
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Improve spacing for mobile */
    .space-y-4 > * + * {
        margin-top: 12px;
    }
    
    .space-y-3 > * + * {
        margin-top: 8px;
    }
    
    /* Make cards full width on mobile */
    .document-card, .tip-card {
        margin-bottom: 16px;
    }
    
    /* Better button spacing */
    .grid > * {
        margin-bottom: 16px;
    }
    
    /* Improve timeline on mobile */
    .timeline-item {
        padding-left: 30px;
        padding-bottom: 20px;
    }
    
    .timeline-item::before {
        left: 10px;
        width: 10px;
        height: 10px;
    }
    
    .timeline-item::after {
        left: 14px;
    }
    
    /* Better tab scrolling */
    .no-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .no-scrollbar::-webkit-scrollbar {
        display: none;
    }
    
    /* Improve form inputs on mobile */
    input[type="email"], 
    input[type="password"], 
    input[type="text"], 
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better modal/prompt sizing */
    .toast {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
    }
    
    /* Improve checklist items on mobile */
    .checklist-item {
        padding: 16px 12px;
        margin-bottom: 12px;
    }
    
    .checklist-item .task-text {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Better card spacing on mobile */
    .bg-white {
        margin-bottom: 16px;
    }
    
    /* Improve button touch targets */
    button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Better icon sizing on mobile */
    .text-2xl {
        font-size: 1.25rem;
    }
    
    /* Responsive text sizing */
    h1 {
        line-height: 1.2;
    }
    
    h2 {
        line-height: 1.3;
    }
    
    h3 {
        line-height: 1.4;
    }
}

/* Tablet specific improvements */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Drag and drop styling */
.drag-over {
    border: 2px dashed #3b82f6;
    background: #eff6ff;
}

/* Document preview styling */
.document-preview {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* Notification toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* Print styles */
@media print {
    nav, .no-print {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Utility classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Better focus states for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Modal styles */
.modal-overlay {
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Ensure modals work on mobile */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999 !important;
    pointer-events: auto;
    touch-action: none;
}

.modal-container.hidden {
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

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

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-error {
    border-color: #ef4444;
}

.form-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Required field indicator */
.required::after {
    content: " *";
    color: #ef4444;
}

/* Modal responsive design */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        width: calc(100% - 2rem);
        max-width: none;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Ensure modals are above everything on mobile */
    .modal-container,
    [id$="Modal"] {
        z-index: 9999 !important;
        position: fixed !important;
    }
    
    /* Better button touch targets */
    .modal-content button {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Prevent viewport issues */
    .modal-content {
        transform: none !important;
    }
}

/* Improve touch feedback */
@media (max-width: 768px) {
    button:active {
        transform: scale(0.98);
    }
    
    .document-card:active,
    .tip-card:active {
        transform: scale(0.99);
    }
}
