/* Custom CSS for Genre of Design */

/* Font Family */
.font-josefin {
    font-family: 'Josefin Sans', sans-serif;
}

/* Navigation Styles */
.nav-link {
    @apply text-gray-700 hover:text-red-600 px-3 py-2 text-sm font-medium transition-colors duration-200;
}

.nav-link.router-link-active {
    @apply text-red-600;
}

.nav-link-simple {
    @apply text-gray-900 hover:text-red-600 text-base font-medium transition-colors duration-200;
}

.nav-link-simple.router-link-active {
    @apply text-red-600;
}

/* Override hover/active color to brand red (#ED1B24) */
.nav-link:hover,
.nav-link.router-link-active,
.nav-link-simple:hover,
.nav-link-simple.router-link-active,
.mobile-nav-link:hover,
.mobile-nav-link.router-link-active {
    color: #ED1B24 !important;
}

/* Explicit active class applied via Navbar component */
.active-link {
    color: #ED1B24 !important;
}

.mobile-nav-link {
    @apply text-gray-700 hover:text-red-600 block px-3 py-2 text-base font-medium transition-colors duration-200;
}

.mobile-nav-link.router-link-active {
    @apply text-red-600;
}

/* Hover Underline Animation */
.hover-underline-animation {
    display: inline-block;
    position: relative;
}

.hover-underline-animation::after {
    content: "";
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 4px;
    bottom: 0;
    left: 0;
    background-color: rgb(220 38 38);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.hover-underline-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Masonry Grid - Always 3 columns on desktop */
.masonry-grid {
    column-count: 1;
    column-gap: 1rem;
    column-fill: balance;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

/* Keep 3 columns even on larger screens */
@media (min-width: 1280px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    /* Ensure items maintain order */
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Card */
.project-card {
    @apply bg-white rounded-lg shadow-md overflow-hidden transition-shadow duration-300;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card .project-image-container {
    height: 100%;
    flex: 1;
}

/* Ensure project card only contains image container */
.project-card {
    padding: 0;
    margin: 0;
}

.project-card > *:not(.project-image-container) {
    display: none !important;
}

.project-image-container {
    @apply relative w-full h-64 overflow-hidden;
    position: relative;
}

.project-image {
    @apply w-full h-full object-cover;
}

.image-placeholder {
    @apply absolute inset-0 flex flex-col items-center justify-center bg-gray-100 text-gray-500;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
    pointer-events: none;
    z-index: 10;
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 11;
}

.project-title-overlay {
    color: white;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.project-location-overlay {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Removed old project title and meta styles - now using overlay styles */

/* Button Styles */
.btn-primary {
    @apply bg-red-600 text-white px-6 py-2 rounded-lg hover:bg-red-700 transition-colors duration-200 font-medium;
}

.btn-secondary {
    @apply bg-gray-200 text-gray-800 px-6 py-2 rounded-lg hover:bg-gray-300 transition-colors duration-200 font-medium;
}

.btn-outline {
    @apply border-2 border-red-600 text-red-600 px-6 py-2 rounded-lg hover:bg-red-600 hover:text-white transition-colors duration-200 font-medium;
}

/* Form Styles */
.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent resize-vertical;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-1;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

/* Loading Spinner */
.loading-spinner {
    @apply animate-spin rounded-full h-8 w-8 border-b-2 border-red-600;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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

/* Slide In Animation */
.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Category Filter */
.category-filter {
    @apply flex flex-wrap gap-2 mb-6;
}

.category-btn {
    @apply px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200;
}

.category-btn.active {
    @apply bg-red-600 text-white;
}

.category-btn:not(.active) {
    @apply bg-gray-200 text-gray-700 hover:bg-gray-300;
}

/* Admin Dashboard */
.dashboard-card {
    @apply bg-white rounded-lg shadow-md p-6;
}

.dashboard-stat {
    @apply text-center;
}

.dashboard-stat-number {
    @apply text-3xl font-bold text-red-600;
}

.dashboard-stat-label {
    @apply text-gray-600 mt-1;
}

/* Table Styles */
.table-container {
    @apply overflow-x-auto;
}

.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table th {
    @apply px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

.table tbody tr:nth-child(even) {
    @apply bg-gray-50;
}

/* Modal Styles */
.modal-overlay {
    @apply fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50;
}

.modal-content {
    @apply bg-white rounded-lg shadow-xl max-w-md w-full mx-4 max-h-screen overflow-y-auto;
}

/* Blog content typographic helpers */
.blog-content h3 {
    @apply text-xl font-semibold mb-2;
}
.blog-content p {
    @apply text-gray-700 leading-7 mb-4;
}

/* Blog grid and cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.25rem;
}
@media (min-width: 640px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.blog-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(0,0,0,0.10);
}
.blog-cover { height: 200px; background:#f3f4f6; }
.blog-cover img { width:100%; height:100%; object-fit:cover; display:block; }

.blog-body { padding: 1rem 1.25rem 1.25rem; }
.blog-meta { color:#6b7280; font-size:.8rem; display:flex; gap:.5rem; align-items:center; margin-bottom:.5rem; }
.blog-title { font-size:1.125rem; font-weight:700; color:#111827; margin-bottom:.25rem; }
.blog-excerpt { color:#4b5563; margin-bottom:1rem; }
.blog-footer { display:flex; align-items:center; justify-content:space-between; }
.blog-author { color:#6b7280; font-size:.875rem; }

.quote { border-left: 4px solid #ED1B24; padding-left: .75rem; font-style: italic; color:#374151; }

/* Toast Notifications */
.toast {
    @apply fixed top-4 right-4 z-50 p-4 rounded-lg shadow-lg max-w-sm;
}

.toast.success {
    @apply bg-green-500 text-white;
}

.toast.error {
    @apply bg-red-500 text-white;
}

.toast.info {
    @apply bg-blue-500 text-white;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        @apply px-4;
    }
    
    .project-card {
        @apply mb-4;
    }
    
    .masonry-grid {
        column-count: 1;
        column-gap: 0.5rem;
    }
}

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

::-webkit-scrollbar-track {
    @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
    @apply bg-gray-400 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-500;
}

/* Focus Styles */
.focus-visible:focus {
    @apply outline-none ring-2 ring-red-500 ring-offset-2;
}

/* Skeleton loading styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 20px;
    margin: 8px 0;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

/* Lazy loading styles */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Skeleton card styles */
.skeleton-card {
    @apply bg-white rounded-lg shadow-md overflow-hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.skeleton-card .skeleton-image {
    flex: 1;
    margin: 0;
}

/* Loading indicator styles */
.loading-more-indicator {
    column-span: all;
    width: 100%;
    text-align: center;
    padding: 2rem 0;
}

/* Modal and Carousel Styles */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Smooth scrolling for carousel */
.carousel-container {
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.carousel-slide {
    scroll-snap-align: start;
}

/* Modal animations */
.modal-enter-active, .modal-leave-active {
    transition: opacity 0.3s ease;
}

.modal-enter-from, .modal-leave-to {
    opacity: 0;
}

/* Project card hover effect */
.project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mobile drawer transition */
.slide-enter-active, .slide-leave-active { transition: transform .3s ease-in-out; will-change: transform; }
.slide-enter-from, .slide-leave-to { transform: translateX(-100%); }

/* Overlay fade transition */
.fade-enter-active, .fade-leave-active { transition: opacity .2s ease-in-out; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* Modal info typography - unify with body */
.modal-info-list {
    font-size: 16px;
    line-height: 28px;
    color: rgba(255,255,255,0.92);
    font-weight: 400;
}

.modal-info-list span {
    font-weight: 400;
}

.modal-info-list i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
}

.modal-info-desc {
    font-size: 16px;
    line-height: 28px;
    color: rgba(255,255,255,0.92);
    font-weight: 400;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}
