/* ===== SmartBalance - Centralized Styles ===== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&display=swap');

/* ===== CSS Variables ===== */
:root {
    --gold-50: #fffbeb;
    --gold-100: #fef3c7;
    --gold-200: #fde68a;
    --gold-300: #fcd34d;
    --gold-400: #fbbf24;
    --gold-500: #f59e0b;
    --gold-600: #d97706;
    --gold-700: #b45309;
    --gold-800: #92400e;

    --navy-900: #1a1a2e;
    --navy-800: #16213e;
    --navy-700: #0f3460;

    --section-header-gradient: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
    --btn-gold-gradient: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    --btn-gold-hover: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    --shadow-gold: 0 8px 20px rgba(245, 158, 11, 0.35);

    --transition-base: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* ===== Base Typography ===== */
body {
    font-family: 'Cairo', sans-serif;
    scroll-behavior: smooth;
}

[dir="ltr"] body {
    font-family: 'Cairo', sans-serif;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

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

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* ===== Animation Classes ===== */
.fade-in {
    animation: fadeIn 1.5s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* Staggered delays for cards */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== Detail / Card fade-in (shared across admin & detail pages) ===== */
.detail-card,
.card-fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.card-fade-in:nth-child(1) { animation-delay: 0.1s; }
.card-fade-in:nth-child(2) { animation-delay: 0.2s; }
.card-fade-in:nth-child(3) { animation-delay: 0.3s; }

/* ===== Swiper container sizing (project detail slider) ===== */
.swiper-container {
    height: 100vh;
    width: 100%;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 640px) {
    .swiper-container { height: 600px; }
}

@media (min-width: 1024px) {
    .swiper-container { height: 700px; }
}

/* ===== Form Card & Fields (shared across admin pages) ===== */
.form-card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.form-field {
    transition: var(--transition-base);
    border: 2px solid #e5e7eb;
}

.form-field:focus-within {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-field label {
    transition: color 0.3s ease;
}

.form-field:focus-within label {
    color: var(--gold-600);
}

/* ===== Buttons ===== */
.btn-gold {
    background: var(--btn-gold-gradient);
    transition: var(--transition-base);
}

.btn-gold:hover {
    background: var(--btn-gold-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-danger {
    transition: var(--transition-base);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ===== Section Header (admin pages) ===== */
.section-header,
.category-header {
    background: var(--section-header-gradient);
}

/* ===== About Section (home page) ===== */
.about-section {
    background: var(--section-header-gradient);
}

.about-grid-pattern {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.about-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    transition: var(--transition-base);
}

.about-stat:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-3px);
}

/* Gradient headline text */
.text-gradient-gold {
    background: linear-gradient(90deg, var(--gold-300), var(--gold-500) 50%, var(--gold-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Same gradient, tuned darker for use on light backgrounds */
.text-gradient-gold-dark {
    background: linear-gradient(90deg, var(--gold-600), var(--gold-500) 50%, var(--gold-700));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Slow floating motion for decorative blobs */
@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, -20px) scale(1.08); }
}

.about-blob {
    animation: floatSlow 9s ease-in-out infinite;
}

.about-blob-delayed {
    animation: floatSlow 11s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Gentle tilt on the logo ring when hovered */
.about-logo-ring {
    transition: transform 0.5s ease;
}

.about-logo-ring:hover {
    transform: rotate(-4deg) scale(1.04);
}

/* Structured about copy (rendered by the rich_about template filter) */
.about-copy {
    max-width: 46rem;
}

.about-lead {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(253, 230, 138, 0.9);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.about-heading,
.about-subheading {
    color: var(--gold-400);
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.about-subheading {
    font-size: 1.05rem;
}

.about-heading::before,
.about-subheading::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gold-400);
    flex-shrink: 0;
}

.about-paragraph {
    color: rgb(209, 213, 219);
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: justify;
}

.about-strong {
    color: var(--gold-300);
    font-weight: 700;
}

.about-tagline {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-inline-start: 3px solid var(--gold-400);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    font-style: italic;
    font-weight: 600;
    color: rgb(253, 230, 138);
}

.about-checklist {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin: 0.5rem 0 1.25rem;
}

@media (min-width: 640px) {
    .about-checklist {
        grid-template-columns: 1fr 1fr;
    }
}

.about-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    padding: 0.7rem 0.85rem;
    transition: var(--transition-base);
}

.about-check-item:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.about-check-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.18);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-top: 0.1rem;
}

.about-check-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.about-check-label {
    color: white;
    font-weight: 700;
}

.about-check-desc {
    color: rgb(203, 213, 225);
}

/* Wave divider under the about section */
.about-wave {
    display: block;
    width: 100%;
    height: 60px;
    line-height: 0;
}

.about-wave svg {
    width: 100%;
    height: 100%;
}

/* ===== Project Card (category listing) ===== */
.project-card {
    transition: var(--transition-base);
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.project-card .project-image-container {
    height: 200px;
}

@media (min-width: 640px) {
    .project-card .project-image-container { height: 300px; }
}

@media (min-width: 768px) {
    .project-card .project-image-container { height: 400px; }
}

@media (min-width: 1024px) {
    .project-card .project-image-container { height: 500px; }
}

/* ===== Image Preview ===== */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-top: 1rem;
    display: block;
}

/* ===== Error Messages ===== */
.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== Multi-image formset (add/edit project & company images) ===== */
.delete-toggle-label input[type="checkbox"] {
    display: none;
}

.image-slot-new input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ===== Image Grid (dashboard) ===== */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.img-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
    transition: transform 0.3s ease;
    border: 2px solid #e5e7eb;
}

.img-grid img:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
    .img-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    .img-grid img {
        height: 60px;
    }
}

/* ===== Project Image Container ===== */
.project-image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.project-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.project-image-container:hover img {
    transform: scale(1.1);
}

/* ===== Info Row (dashboard) ===== */
.info-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    min-width: 140px;
    font-weight: 600;
    color: #374151;
}

.info-value {
    color: #6b7280;
    word-break: break-word;
}

@media (max-width: 640px) {
    .info-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    .info-label {
        min-width: auto;
    }
}

/* ===== Badges ===== */
.badge-category {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
}

.badge-project {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* ===== Parallax ===== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===== Slide Navigation ===== */
.slide-nav-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
}

.slide-nav-btn:hover {
    background: rgba(245, 158, 11, 0.9);
    transform: scale(1.1);
}

.slide {
    animation: slideFade 0.4s ease-in-out;
}

/* ===== Category & Project Items ===== */
.category-item,
.project-item {
    transition: var(--transition-base);
}

.category-item:hover,
.project-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== Stat Card ===== */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ===== Project Overlay ===== */
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-image-container:hover .project-overlay {
    opacity: 1;
}

.project-name-description {
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.project-image-container:hover .project-name-description {
    transform: translateY(0);
}

/* ===== Gradient background ===== */
.gradient-bg {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
}

/* ===== Input Fields ===== */
.input-field {
    transition: var(--transition-base);
    border: 2px solid #e5e7eb;
}

.input-field:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    outline: none;
}

.input-icon {
    transition: color 0.3s ease;
}

.input-group:focus-within .input-icon {
    color: var(--gold-500);
}

/* ===== Coming Soon ===== */
.pulse {
    animation: pulse 2s infinite;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--gold-400);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.logo-bounce {
    animation: logoBounce 3s ease-in-out infinite;
}

/* ===== Swiper overrides ===== */
.swiper-button-next,
.swiper-button-prev {
    color: var(--gold-500) !important;
    background: rgba(0, 0, 0, 0.5);
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    transition: var(--transition-base);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

/* ===== Action Button Group ===== */
.action-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Hero transition ===== */
#hero {
    transition: background-image 1s ease-in-out;
}

/* ===== RTL Helpers ===== */
[dir="rtl"] .swiper-button-next {
    right: auto !important;
    left: 10px !important;
}

[dir="rtl"] .swiper-button-prev {
    left: auto !important;
    right: 10px !important;
}

