/* ===== Floating Label for Contact Form ===== */
.floating-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.floating-group input,
.floating-group textarea,
.floating-group select {
    width: 100%;
    padding: 1.3rem 0.85rem 0.55rem;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0.75rem;
    color: #fff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    font-size: 0.9rem;
}

.floating-group textarea {
    padding-top: 1.6rem;
    min-height: 110px;
    resize: vertical;
}
.floating-group input:focus,
.floating-group textarea:focus,
.floating-group select:focus {
    border-color: #2A9D8F;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(42,157,143,0.12);
}
.floating-group label {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    transition: all 0.22s ease;
    pointer-events: none;
    font-size: 0.875rem;
    z-index: 1;
}
.floating-group label.left {
    right: auto !important;
    left: 2.4rem !important;
}
.floating-group textarea + label {
    top: 1.1rem;
    transform: none;
}
.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label,
.floating-group textarea:focus + label,
.floating-group textarea:not(:placeholder-shown) + label,
.floating-group select:focus + label,
.floating-group select.has-value + label {
    top: -0.8rem;
    transform: translateY(0);
    font-size: 0.68rem;
    color: #2A9D8F;
    background: linear-gradient(to bottom, #0f172a 50%, transparent 50%);
    padding: 0.3rem 0.35rem 2rem;
}

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    padding: 0.85rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: toastIn 0.4s ease forwards;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    direction: rtl;
}
.toast-success {
    background: linear-gradient(135deg, #065f46, #047857);
    color: #fff;
    border: 1px solid rgba(16,185,129,0.3);
}
.toast-error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: #fff;
    border: 1px solid rgba(239,68,68,0.3);
}
.toast-info {
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
    color: #fff;
    border: 1px solid rgba(59,130,246,0.3);
}
.toast-out {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9998;
    background: transparent;
}
.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2A9D8F, #1a675f);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ===== Sticky Sidebar ===== */
.sticky-sidebar {
    position: sticky;
    top: 2rem;
}
.sticky-sidebar-scroll {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}
.sticky-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}
.sticky-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #2A9D8F;
    border-radius: 4px;
}

/* ===== Page Load Fade ===== */
.page-fade {
    animation: pageFadeIn 0.6s ease;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Card Enhanced Hover ===== */
.card-enhanced {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card-enhanced:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* ===== Gradient Text Animation ===== */
.gradient-text-animated {
    background: linear-gradient(135deg, #2A9D8F, #1a675f, #2A9D8F);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== Glow Effect ===== */
.glow-primary {
    box-shadow: 0 0 20px rgba(42,157,143,0.15);
    transition: box-shadow 0.3s ease;
}
.glow-primary:hover {
    box-shadow: 0 0 30px rgba(42,157,143,0.25);
}

/* ===== Image Overlay Zoom ===== */
.img-zoom {
    overflow: hidden;
}
.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.img-zoom:hover img {
    transform: scale(1.08);
}

/* ===== Pulse Dot ===== */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2A9D8F;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(42,157,143,0.6); }
    70% { box-shadow: 0 0 0 10px rgba(42,157,143,0); }
    100% { box-shadow: 0 0 0 0 rgba(42,157,143,0); }
}

/* ===== Skeleton Loader ===== */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
    border-radius: 0.5rem;
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Ripple Button Effect ===== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s ease;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ===== Counter Animation ===== */
.counter-value {
    display: inline-block;
}

/* ===== Nav Link Underline Animation ===== */
.nav-underline {
    position: relative;
}
.nav-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: #2A9D8F;
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-underline:hover::after,
.nav-underline.active::after {
    width: 100%;
}

/* ===== Background Textures ===== */
.texture-noise,
.texture-noise-light,
.texture-noise-heavy,
.texture-grid,
.texture-dots,
.texture-diagonal {
    position: relative;
}

.texture-noise::before,
.texture-noise-light::before,
.texture-noise-heavy::before,
.texture-grid::before,
.texture-dots::before,
.texture-diagonal::before {
    content: '';
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
}

/* Grain / Noise — subtle over dark backgrounds */
.texture-noise::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    mix-blend-mode: overlay;
}
.texture-noise-light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    mix-blend-mode: overlay;
}

/* Heavy noise for hero / prominence */
.texture-noise-heavy::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    mix-blend-mode: overlay;
}

/* Subtle grid */
.texture-grid::before {
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Subtle dots */
.texture-dots::before {
    background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Diagonal construction lines */
.texture-diagonal::before {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 30px,
        rgba(255,255,255,.05) 30px,
        rgba(255,255,255,.05) 31px
    );
    background-size: 42px 42px;
}

/* ===== Prose / Typography for page content ===== */
.prose {
    color: #cbd5e1;
    line-height: 1.9;
    font-size: 1rem;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: #fff;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.prose h1 { font-size: 1.875rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }
.prose p {
    margin-bottom: 1rem;
    color: #cbd5e1;
}
.prose ul,
.prose ol {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}
.prose li {
    margin-bottom: 0.25rem;
}
.prose ul li {
    list-style-type: disc;
}
.prose ol li {
    list-style-type: decimal;
}
.prose a {
    color: #2A9D8F;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
.prose a:hover {
    color: #3aaf9e;
}
.prose strong {
    color: #fff;
    font-weight: 700;
}
.prose blockquote {
    border-right: 3px solid #2A9D8F;
    padding-right: 1rem;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-style: italic;
    background: rgba(255,255,255,0.03);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1rem 1.25rem;
}
.prose img {
    border-radius: 0.75rem;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
}
.prose pre {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    direction: ltr;
    text-align: left;
}
.prose code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.15rem 0.4rem;
    border-radius: 0.375rem;
    font-size: 0.875em;
    border: 1px solid #334155;
}
.prose pre code {
    background: none;
    border: none;
    padding: 0;
}
.prose hr {
    border-color: #334155;
    margin: 2rem 0;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.prose th,
.prose td {
    border: 1px solid #334155;
    padding: 0.75rem;
    text-align: right;
}
.prose th {
    background: #1e293b;
    color: #fff;
    font-weight: 700;
}
.prose td {
    color: #cbd5e1;
}
