/* Custom styles that extend Tailwind CSS - Non-critical styles only */

/* Project description HTML styling */
.project-description h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e40af;
    margin-block: 1.5rem 1rem;
    line-height: 1.4;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.project-description h2:first-child {
    margin-top: 0;
}

.project-description p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #374151;
}

.project-description ul {
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

.project-description li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.project-description strong {
    font-weight: 600;
    color: #1f2937;
}

.project-description em {
    font-style: italic;
    color: #6b7280;
}

.project-description a {
    color: #1e40af;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.project-description a:hover {
    color: #1d4ed8;
}

/* Custom gradient utilities */
.gradient-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
}

.gold-gradient {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* Custom animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Custom utility classes */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Custom card image container */
.card-image-container {
    width: 100%;
    height: 12rem;
    background-color: #f3f4f6;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    z-index: 1;
}

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

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

/* Skeleton loading for images */
.card-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    z-index: 0;
}

/* Defer render utility */
.defer-render {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.defer-render.loaded {
    opacity: 1;
}

/* RTL specific utilities */
.space-x-reverse> :not([hidden])~ :not([hidden]) {
    margin-right: 1rem;
    margin-left: 0;
}

/* Hero section styles */
.hero-logo {
    height: 6rem;
    width: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 900;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #3730a3 50%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

/* Utility classes for layout */
.min-height-60vh {
    min-height: 60vh;
}

.min-height-400 {
    min-height: 400px;
}

/* Form styles */
.hidden-select {
    display: none;
}

.inline-form {
    display: inline;
}

/* Enhanced card styles */
.feature-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    position: relative;
}

.feature-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.2);
}

.feature-card-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.feature-card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.feature-card-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feature-card-subtitle {
    opacity: 0.95;
    font-size: 1rem;
    font-weight: 500;
}

.feature-card-body {
    padding: 2.5rem 2rem;
}

.feature-card-description {
    color: #4b5563;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

.feature-card-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.feature-card-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Section divider */
.section-divider {
    width: 6rem;
    height: 0.25rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    margin: 1rem auto;
    border-radius: 9999px;
}

/* Enhanced latest items section */
.latest-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (min-width: 768px) {
    .latest-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .latest-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.item-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.item-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-card-footer {
    padding: 1.5rem;
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* Enhanced button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 114, 128, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

/* Enhanced page layout */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    text-align: center;
}

.page-description {
    font-size: 1.125rem;
    color: #64748b;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Enhanced grid layouts */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (min-width: 768px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Enhanced form styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

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

/* Enhanced alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

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

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

/* Responsive improvements */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
        min-height: 80px;
    }

    .hero-logo {
        height: 4rem;
    }

    .latest-items-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card-header {
        padding: 1.5rem;
    }

    .feature-card-body {
        padding: 1.5rem;
    }
}