/**
 * Base Styles
 * Reset, typography, and global styles
 * Path: bahamus_website/frontend/assets/css/base.css
 *
 * @package    Bahamus
 * @version    2.0.0
 */


/* ============================================================
   RESET & NORMALIZATION
============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    font-family: var(--font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans) !important;
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    text-rendering: optimizeSpeed;
}

a, abbr, address, article, aside, audio, b, blockquote, body, canvas, caption, cite, code,
dd, del, details, dfn, div, dl, dt, em, embed, fieldset, figcaption, figure, footer, form,
h1, h2, h3, h4, h5, h6, header, html, i, iframe, img, ins, kbd, label, legend, li, main,
mark, nav, object, ol, output, p, pre, q, ruby, s, samp, section, small, span, strong, sub,
summary, sup, table, tbody, td, tfoot, th, thead, time, tr, u, ul, var, video
{
    font: inherit;
    vertical-align: baseline;
    font-family: var(--font-sans);
}


/* ============================================================
   TYPOGRAPHY
============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-4xl);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    margin-bottom: 1rem;
    line-height: var(--leading-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

strong, b {
    font-weight: var(--font-semibold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--text-sm);
}

/* ============================================================
   LISTS
============================================================ */

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

ul.unstyled,
ol.unstyled {
    list-style: none;
    padding-left: 0;
}

/* ============================================================
   IMAGES & MEDIA
============================================================ */

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
}

/* ============================================================
   FORMS
============================================================ */

button, input, optgroup, select, textarea {
    font-family: var(--font-sans);
    font-size: 100%;
    line-height: inherit;
    margin: 0;
}

button, select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    cursor: pointer;
}

button:disabled,
[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: white;
    font-size: var(--text-base);
    transition: var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(232, 96, 42, 0.12);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ============================================================
   TABLES
============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: var(--font-semibold);
    background-color: var(--gray-50);
}

tr:hover {
    background-color: var(--gray-50);
}

/* ============================================================
   UTILITIES
============================================================ */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

@media (min-width: 640px) {
    .container {
        padding: 0 calc(var(--container-padding) * 1.5);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 calc(var(--container-padding) * 2);
    }
}

/* Section */
.section {
    padding: var(--spacing-16) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--spacing-20) 0;
    }
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card — flat/minimal */
.card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-6);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

/* Button Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.125rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

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

/* Aspect Ratio Boxes */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* ============================================================
   SCROLLBAR
============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

/* ============================================================
   SELECTION
============================================================ */

::selection {
    background-color: rgba(232, 96, 42, 0.15);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: rgba(232, 96, 42, 0.15);
    color: var(--text-primary);
}

/* ============================================================
   FOCUS VISIBLE
============================================================ */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================================
   ALPINE.JS CLOAK
============================================================ */

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

/* ============================================================
   LOADING STATE
============================================================ */

.loading {
    pointer-events: none;
    opacity: 0.6;
    cursor: wait;
}

/* Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes scroll-clients {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.85; transform: scale(1.03); }
}

/* Animation Classes */
.animate-fadeIn        { animation: fadeIn var(--duration-500) var(--ease-out); }
.animate-fadeInUp      { animation: fadeInUp var(--duration-500) var(--ease-out); }
.animate-fadeInDown    { animation: fadeInDown var(--duration-500) var(--ease-out); }
.animate-slideInLeft   { animation: slideInLeft var(--duration-500) var(--ease-out); }
.animate-slideInRight  { animation: slideInRight var(--duration-500) var(--ease-out); }
.animate-scaleIn       { animation: scaleIn var(--duration-300) var(--ease-out); }

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

.animate-scroll-clients {
    animation: scroll-clients 40s linear infinite;
    will-change: transform;
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

.animate-scroll-clients:hover {
    animation-play-state: paused;
}

/* ============================================================
   ABOUT SECTION — LIVE BACKGROUND & ELEMENT ANIMATIONS
============================================================ */

@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(2%, 3%) scale(1.05); }
    50%       { transform: translate(-1.5%, -2%) scale(0.96); }
    75%       { transform: translate(3%, -1%) scale(1.04); }
}

@keyframes about-img-breathe {
    0%, 100% { transform: scale(1.0); }
    50%       { transform: scale(1.05); }
}

@keyframes badge-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-9px); }
}

.animate-orb-drift {
    animation: orb-drift 14s ease-in-out infinite;
}

.animate-orb-drift-2 {
    animation: orb-drift 20s ease-in-out infinite reverse;
    animation-delay: -5s;
}

.animate-orb-drift-3 {
    animation: orb-drift 17s ease-in-out infinite;
    animation-delay: -9s;
}

.animate-img-breathe {
    animation: about-img-breathe 14s ease-in-out infinite;
}

.animate-badge-float {
    animation: badge-float 4.5s ease-in-out infinite;
}

/* ============================================================
   ABOUT SECTION — FLUID STREAM & RIPPLE ANIMATIONS
============================================================ */

@keyframes stream-flow {
    0%   { stroke-dashoffset: 2500; opacity: 0; }
    8%   { opacity: 1; }
    88%  { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes ripple-out {
    0%   { transform: scale(0.4); opacity: 0.28; }
    100% { transform: scale(4.5); opacity: 0; }
}

@keyframes shimmer-diagonal {
    0%   { transform: translateX(-200%) skewX(-20deg); }
    100% { transform: translateX(350%)  skewX(-20deg); }
}

.about-stream-line {
    stroke-dasharray: 2500;
    stroke-dashoffset: 2500;
    animation: stream-flow 10s ease-in-out infinite;
}

.animate-ripple-out {
    animation: ripple-out 5s ease-out infinite;
}

.animate-shimmer-diagonal {
    animation: shimmer-diagonal 14s ease-in-out infinite;
    animation-delay: 4s;
}

/* Scroll-reveal — about section */
.about-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-image-reveal {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-visible .about-reveal,
.about-visible .about-image-reveal {
    opacity: 1;
    transform: translate(0, 0);
}

/* Why Choose Us section scroll reveals */
.wcu-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.wcu-image-reveal {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.wcu-visible .wcu-reveal,
.wcu-visible .wcu-image-reveal {
    opacity: 1;
    transform: translate(0, 0);
}

/* Hero slides under navbar for transparency effect */
#app-content {
    margin-top: -70px;
}

/* ============================================================
   RESPONSIVE UTILITIES
============================================================ */

.hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .sm\:hidden { display: none !important; }
    .sm\:block  { display: block !important; }
}

@media (min-width: 768px) {
    .md\:hidden { display: none !important; }
    .md\:block  { display: block !important; }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none !important; }
    .lg\:block  { display: block !important; }
}

@media (max-width: 1024px) {
    #app-content {
        margin-top: -70px;
    }
}

/* ============================================================
   SERVICE CARDS STYLES
============================================================ */

.service-card {
    position: relative;
    overflow: hidden;
    height: 28rem;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

.service-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover img {
    transform: scale(1.06);
}

.service-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.78) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    transition: background 0.3s ease;
}

.service-card:hover .service-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.88) 100%);
}

.service-number {
    font-family: var(--font-heading);
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--color-primary);
    opacity: 0.4;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.service-card:hover .service-number {
    opacity: 0.65;
    transform: translateY(-6px);
}

.service-title {
    font-family: var(--font-heading);
    font-size: 1.625rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.875rem;
    transition: color 0.3s ease;
}

.service-card:hover .service-title {
    color: var(--color-primary-light);
}

.service-description {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: gap 0.3s ease;
}

.service-link:hover {
    gap: 1rem;
    color: var(--color-primary-light);
}

.service-link i {
    transition: transform 0.3s ease;
}

.service-link:hover i {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .service-card {
        height: 400px;
    }

    .service-number {
        font-size: 5rem;
    }

    .service-title {
        font-size: 1.375rem;
    }

    .service-description {
        font-size: 0.875rem;
    }
}

/* ============================================================
   PRINT STYLES
============================================================ */

@media print {
    body {
        background: white;
        color: black;
    }

    .no-print,
    nav,
    footer,
    button {
        display: none !important;
    }

    a {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }
}
