/**
 * Copyright © YoungDogs. All rights reserved.
 * Projects Module Styles
 */

/* =================================================================
   SVG Icon Sizing - Explicit sizes to override any Tailwind issues
   ================================================================= */

/* Default SVG sizing for all project areas - prevent oversized icons */
.add-to-project-section svg,
.projects-list-container svg,
.project-detail-container svg,
.project-items-container svg {
    max-width: 1.5rem;
    max-height: 1.5rem;
}

/* Force proper SVG sizing */
.add-to-project-section svg,
.project-list svg,
.project-detail svg,
.project-card svg,
.project-item-config svg {
    flex-shrink: 0;
}

/* Small icons (16px) */
.add-to-project-section svg.inline,
.project-item-config svg.inline,
svg.w-4 {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
}

/* Medium icons (20px) */
svg.w-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 1.25rem !important;
    max-height: 1.25rem !important;
}

/* Default/Standard icons (24px) */
svg.w-6,
.add-to-project-section button svg,
.project-card button svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
}

/* Stats icons (24px) */
.project-detail-container .bg-white svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
}

/* Larger decorative icons (48px) */
svg.w-12 {
    width: 3rem !important;
    height: 3rem !important;
    max-width: 3rem !important;
    max-height: 3rem !important;
}

/* Extra large empty state icons (64px) */
svg.w-16 {
    width: 4rem !important;
    height: 4rem !important;
    max-width: 4rem !important;
    max-height: 4rem !important;
}

/* =================================================================
   Product Page - Add to Project Section
   ================================================================= */

.add-to-project-section {
    max-width: 100%;
}

.add-to-project-section select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.add-to-project-section select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Gradient backgrounds */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-blue-50 {
    --tw-gradient-from: #eff6ff;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(239, 246, 255, 0));
}

.to-indigo-50 {
    --tw-gradient-to: #eef2ff;
}

.from-blue-600 {
    --tw-gradient-from: #2563eb;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(37, 99, 235, 0));
}

.to-indigo-600 {
    --tw-gradient-to: #4f46e5;
}

/* Button animations */
.add-to-project-section button {
    position: relative;
    overflow: hidden;
}

.add-to-project-section button:not(:disabled):hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.add-to-project-section button:not(:disabled):active {
    transform: scale(0.98);
}

/* =================================================================
   My Projects Page - Project Cards
   ================================================================= */

/* Project Cards */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

/* Line clamping for browsers that don't support line-clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Alpine cloak */
[x-cloak] {
    display: none !important;
}

/* Smooth animations */
.project-card,
.project-card * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Grid responsive adjustments */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .add-to-project-section .flex-col {
        flex-direction: column;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Button hover effects */
.project-card button,
.project-card a {
    position: relative;
    overflow: hidden;
}

.project-card button::after,
.project-card a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.project-card button:hover::after,
.project-card a:hover::after {
    width: 300px;
    height: 300px;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.modal-backdrop {
    animation: fadeIn 0.3s ease;
}

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

/* Configuration display styles */
.project-item-config {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-left: 3px solid #3B82F6;
    transition: all 0.3s ease;
}

.project-item-config:hover {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.project-item-config svg {
    filter: drop-shadow(0 1px 2px rgba(59, 130, 246, 0.3));
}

.config-option-bullet {
    color: #3B82F6;
    font-weight: bold;
}

/* Stats grid styling */
.project-card .bg-gray-50 {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Empty state styling */
.empty-projects {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading state */
.loading-shimmer {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

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

/* Info boxes */
.add-to-project-section .bg-blue-50 {
    background-color: #eff6ff;
}

.add-to-project-section .border-blue-200 {
    border-color: #bfdbfe;
}

.add-to-project-section .text-blue-800 {
    color: #1e40af;
}

/* Responsive design for product page */
@media (max-width: 640px) {
    .add-to-project-section {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Print styles */
@media print {
    .project-card {
        page-break-inside: avoid;
        break-inside: avoid;
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
    }
    
    .project-card button,
    .modal-backdrop,
    .add-to-project-section {
        display: none !important;
    }
}

