/* Itinerary Builder Styles */

/* Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Calendar Styles */
.calendar-month {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #eef2ff, #ffffff);
}

.calendar-month-name {
    font-weight: 700;
    color: #111827;
    font-size: 1.125rem;
}

.nav-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}

.nav-btn:hover:not([data-disabled]) {
    background-color: #e0e7ff;
}

.nav-btn[data-disabled] {
    cursor: not-allowed;
    opacity: 0.3;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    padding: 0.5rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-day {
    position: relative;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 3rem;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background-color: #eef2ff;
}

.calendar-day.other-month {
    cursor: default;
    visibility: hidden;
}

.calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background-color: #f9fafb;
}

.calendar-day.disabled:hover {
    background-color: #f9fafb;
}

.calendar-day.today {
    font-weight: 700;
    color: #4f46e5;
}

.calendar-day.today::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0.25rem;
    height: 0.25rem;
    background-color: #4f46e5;
    border-radius: 50%;
}

.calendar-day.range-start,
.calendar-day.range-end {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.calendar-day.range-hover {
    background-color: #e0e7ff;
}

.calendar-day.selected-period {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day.selected-period:hover {
    background-color: #e5e7eb;
}

/* Activity Modal Styles */
.activity-modal {
    max-height: 80vh;
    overflow-y: auto;
}

/* Category tabs container - horizontal scroll on mobile */
#activity-modal .category-tabs-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Webkit scrollbar styling for category tabs */
#activity-modal .category-tabs-container::-webkit-scrollbar {
    height: 8px;
}

#activity-modal .category-tabs-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#activity-modal .category-tabs-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#activity-modal .category-tabs-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.activity-category-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 2px solid;
    cursor: pointer;
    white-space: nowrap;
}

.activity-category-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.activity-category-btn:not(.active) {
    background-color: #ffffff;
    color: #374151;
    border-color: #e5e7eb;
}

.activity-category-btn:not(.active):hover {
    border-color: #c7d2fe;
    background-color: #eef2ff;
}

.activity-card {
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.activity-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.activity-card.selected {
    border-color: #4f46e5;
    background-color: #ffffff;
}

.activity-card img {
    width: 60px;
    height: auto;
    object-fit: contain;
    margin:auto;
    margin-bottom: 0.5rem;
}

.activity-card .activity-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
    text-align: center;
    line-height: 1.25;
}

/* Itinerary Grid Styles */
#itinerary-grid {
    display: grid;
    gap: 0;
}

.day-card {
    background-color: #ffffff;
    padding: 0.75rem;
    transition: all 0.2s;
    min-height: 14rem;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.day-card:hover {
    background-color: #f9fafb;
}

.day-header {
    text-align: center;
    margin-bottom: 1rem;
}

.day-label {
    font-weight: 700;
    color: #4f46e5;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.day-name {
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
}

.day-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.activity-item {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    min-width: 0;
    cursor: move;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.activity-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.activity-item.dragging {
    opacity: 0.5;
}

.activity-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.activity-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-image {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    object-fit: cover;
    flex-shrink: 0;
}

.activity-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #111827;
}

.remove-activity {
    color: #ef4444;
    padding: 0.25rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: color 0.2s;
}

.remove-activity:hover {
    color: #b91c1c;
}

.remove-activity svg {
    width: 0.75rem;
    height: 0.75rem;
}

.drop-zone {
    height: 0.25rem;
    border-radius: 0.125rem;
    border: 2px dashed transparent;
    transition: all 0.2s;
}

.drop-zone.active {
    border-color: #60a5fa;
    background-color: #dbeafe;
    height: 0.75rem;
}

.empty-day {
    height: 3rem;
    border-radius: 0.5rem;
    border: 2px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-center;
    color: #9ca3af;
    font-size: 0.75rem;
}


.add-activity-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Drag and Drop States */
.day-card.drag-over {
    background-color: #dbeafe;
    ring: 2px solid #60a5fa;
}

/* Print Styles */
@media print {
    @page {
        size: landscape;
        margin: 0.3in;
    }
    
    /* Additional landscape forcing for mobile browsers */
    @page :first {
        size: landscape;
    }
    
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
    }
    
    body * {
        visibility: hidden;
    }
    
    .print-area, .print-area * {
        visibility: visible;
    }
    
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* Preserve background colors in print */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Prevent page breaks inside calendar rows */
    [style*="page-break-inside: avoid"] {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Allow page breaks between rows but not inside them */
    .print-area > div > div[style*="grid-template-columns"] {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    .bg-red-400 { 
        background-color: #f87171 !important; 
    }
    .bg-orange-400 { 
        background-color: #fb923c !important; 
    }
    .bg-yellow-400 { 
        background-color: #fbbf24 !important; 
    }
    .bg-green-400 { 
        background-color: #4ade80 !important; 
    }
    .bg-blue-400 { 
        background-color: #60a5fa !important; 
    }
    .bg-purple-400 { 
        background-color: #a78bfa !important; 
    }
    .bg-pink-400 { 
        background-color: #f472b6 !important; 
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Hide second calendar on mobile */
    #calendar-month-2 {
        display: none;
    }
    
    /* Stack itinerary grid vertically on mobile */
    #itinerary-grid {
        grid-template-columns: 1fr !important;
    }
    
    .day-card {
        border-right: none;
    }
    
    /* Adjust hero section padding */
    #hero-section .relative.z-10 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    #hero-section h1 {
        font-size: 2rem;
    }
    
    #hero-section p {
        font-size: 1rem;
    }
}


@media (max-width: 640px) {
    /* Smaller activity cards on mobile */
    .activity-card {
        padding: 0.75rem;
    }
    
    .activity-card img {
        height: 3rem;
    }
    
    .activity-card .activity-name {
        font-size: 0.75rem;
    }
    
    
    #activities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Custom Activities */
.custom-activity-item {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.custom-activity-name {
    flex: 1;
    font-weight: 500;
    color: #111827;
}

.custom-activity-actions {
    display: flex;
    gap: 0.5rem;
}

.custom-activity-actions button {
    padding: 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s;
}

.custom-activity-actions .edit-btn {
    color: #3b82f6;
}

.custom-activity-actions .edit-btn:hover {
    color: #1d4ed8;
}

.custom-activity-actions .delete-btn {
    color: #ef4444;
}

.custom-activity-actions .delete-btn:hover {
    color: #b91c1c;
}

/* Notification Toast */
#notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#notification.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Utility Classes */
.no-print {
    /* Will be hidden in print mode */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}
/* Modal button responsive width */
.modal-btn { 
    width: auto; 
}

@media (max-width: 360px) {
    .modal-btn { 
        width: 100%; 
    }
}

/* Mobile footer visibility at 900px breakpoint */
@media (min-width: 900px) {
    #mobile-footer-planning, 
    #mobile-footer-preview { 
        display: none !important; 
    }
    .hidden-below-900 { 
        display: block !important; 
    }
    .hidden-below-900-flex { 
        display: flex !important; 
    }
}

@media (max-width: 899px) {
    .hidden-below-900, 
    .hidden-below-900-flex { 
        display: none !important; 
    }
}

#mobile-footer-planning.hidden { 
    display: none !important; 
}

#mobile-footer-preview.hidden { 
    display: none !important; 
}

/* Smooth transition for mobile footer visibility */
#mobile-footer-planning,
#mobile-footer-preview {
    transition: opacity 0.3s ease-in-out;
}

/* Center modal buttons on small screens */
@media (max-width: 370px) {
	.modal-buttons { flex-wrap:wrap; gap:0 !important; }
    .modal-buttons button { width:100%; }
}

@media (max-width: 500px) {
	#builder-section { padding-top: 2rem; padding-bottom: 2rem; }
	
	#custom-activity-creator .flex.gap-2 { flex-wrap:wrap; }
	#custom-activity-creator input { width:100%; flex:none; }
	
	#planning-mode .bg-white.rounded-xl.shadow-sm.border.border-gray-200.p-6 { padding:0; overflow:hidden; }
	#planning-mode .bg-white.rounded-xl.shadow-sm.border.border-gray-200.p-6 h2 { padding: 1.5rem; padding-bottom:0; }
	#planning-mode .bg-white.rounded-xl.shadow-sm.border.border-gray-200.p-6 p { padding: 1.5rem; padding-bottom:0; padding-top:0; }
	#itinerary-grid { border-radius:0; border-left:0; border-right:0; }
	
	#preview-mode .print-area { padding:0; overflow:hidden; }
	
	#preview-mode .print-area #preview-title { padding: 1.5rem; padding-bottom:0; }
	#preview-mode .print-area #preview-dates { padding: 1.5rem; padding-bottom:0; padding-top:0; }
	#preview-mode .print-area .border.border-gray-300.bg-white.rounded-lg.overflow-hidden { border-radius:0; border-left:0; border-right:0; }
}

/* Mobile notification positioning - move to bottom center at 500px and below */
@media (max-width: 500px) {
    .fixed.top-4.right-4 {
        top: auto !important;
        right: auto !important;
        bottom: 1rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
		width: calc(100% - 2rem) !important;
    }
	
}