/* --- CLEAN SYSTEM CONTAINER GRID --- */

.grid, [class*="services-grid"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    width: 100% !important;
}

/* --- THE MASTER CLICK-THROUGH HOOK --- */
a.service-title-text {
    position: absolute !important;
    inset: 0 !important;
    z-index: 50 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: flex-end !important;
    cursor: pointer !important;
    /* Forces all system card links to navigate inside the same window natively */
    target-name: _self !important;
}

/* --- LOCK THE ALBUMS GRID RENDER MAP INTO 200X200 SQUARES --- */
div.service-card {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    border-radius: 12px !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
}

/* Clear out default small icon frames if they generate in the background */
.custom-icon, .service-icon, div[class*="icon_"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Premium hover lift transform animations */
div.service-card:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.2s ease;
}

/* --- THE SOLID EDGED DARK BACKPLATE OVERLAY --- Album Description */
.service-name {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.7) 80%, rgba(15, 23, 42, 0) 100%) !important;
    width: 100% !important;
    padding: 12px 10px 4px 10px !important; /* (Top, Right, Bottom, Left) */
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 0 12px 12px !important;
    z-index: 10 !important;
    font-size: 12px !important; /* originally 13px */
    font-weight: 600 !important;
    color: #f8fafc !important;
    line-height: 1.3 !important;
}

.service-description {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin: 2px 0 0 0 !important;
}

/* --- IMMICH CHARCOAL-BLACK BACKGROUND SYSTEM OVERRIDES --- */
body, #__next, #page_wrapper, #page_container, #inner_wrapper, .theme-stone, .dark {
    background-color: #111111 !important;
}

/* --- THE MASTER YOUTUBE RESPONSIVE BANNER BOX --- */
/* Target the inner wrapper element to allow the image banner to scale wide without chopping */
div[id="inner_wrapper"]::before {
    content: "" !important;
    display: block !important;
    width: 100% !important;
    max-width: 1200px !important;
    height: 300px !important;
    margin: 25px auto 10px auto !important;
    background: url('/images/banner.png') center center / cover no-repeat !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* --- THE NATIVE GLOBAL ROW DIVIDER LINE STRIPPER --- */
/* Forcibly overwrites color, width, and native tailwind opacity masks to snap the line to orange */
hr,
.border-b,
div[class*="border-"],
header[class*="border-"],
[class*="border-stone"],
[class*="border-neutral"] {
    border-color: #9e9e9e !important;       /* ffa600=orange 9e9e9e=grey */
    border-bottom-color: #9e9e9e !important;
    border-bottom-width: 1px !important;    /* Clean, distinct 2px thickness profile */
    border-opacity: 1 !important;           /* Shatters native semi-transparent fade masks */
    opacity: 1 !important;
}


/* --- AUTOMATED IPHONE RESPONSIVENESS --- */
@media (max-width: 768px) {
    div[id="inner_wrapper"]::before {
        height: 110px !important;
        width: calc(100% - 24px) !important;
        margin: 15px auto 5px auto !important;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        display: grid !important;
    }

    div.service-card {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 165px !important;
        min-height: 165px !important;
        max-height: 165px !important;
    }

    .service-name { font-size: 11px !important; line-height: 1.2 !important; }
    .service-description { font-size: 9px !important; display: block !important; visibility: visible !important; height: auto !important; opacity: 1 !important; }
}

@media (max-width: 950px) and (orientation: landscape) {
    div.service-card {
        height: 125px !important;
        min-height: 125px !important;
        max-height: 125px !important;
    }
}

/* --- --------------------------------------------------------------------- --- */

/* --- THE OFFICIAL IMMICH-ORANGE FLOATING ACTION BUTTON --- */
/* Completely isolates the button from Homepage's grid constraints and floats it in the corner */
.immich-map-fab {
    position: fixed !important;
    bottom: 30px !important;       /* Clean spacing distance from the floor layout boundary */
    right: 30px !important;        /* Clean spacing distance from the right panel boundary */
    z-index: 999999 !important;    /* Absolute highest layering priority on the page */
    background-color: #ffa600 !important; /* ea580c  ff7824 Premium Immich orange accent backdrop theme plate */
    opacity: 0.75 !important;
    border: 1px solid #ff7824 !important;
    border-radius: 30px !important; /* 30px Smoothly rounded capsule tablet app shape */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6) !important; /* Deep drop shadow lift effect */
    padding: 8px 12px !important; /* 12px top/bottom and 22px left/right pushes the orange walls out away from your text */

    /* TEXT & FONT GEOMETRY STYLING */
    font-size: 13px !important;  /* 13px Controls the physical height footprint of the text string labels */
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    font-family: sans-serif !important;
    text-decoration: none !important;

    /* ALIGNMENT BLOCKS */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: max-content !important;
    height: auto !important;
    cursor: pointer !important;
    pointer-events: auto !important;

    /* PREPARES SMOOTH HOVER ANIMATION TIMINGS */
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* --- THE FANCY HOVER-OVER FEEL --- */
/* Gently lifts the button upward and brightens the orange glow when you hover your cursor arrow over it */
.immich-map-fab:hover {
    transform: translateY(-4px) scale(1.04) !important; /* Elegant vertical lift and scale response interaction */
    background-color: #fcb838 !important; /* f97316 Vivid orange hover color matching Immich */
    box-shadow: 0 5px 10px rgba(255, 166, 0, 0.3) !important; /* 234 88 12 Adds a soft orange ambient glow underneath */
}

/* Add subtle pressed feedback look when clicked */
.immich-map-fab:active {
    transform: translateY(-1px) scale(0.98) !important;
}

/* --- AUTOMATED MOBILE SCREEN PERSISTENT POSITION TUNING --- */
@media (max-width: 768px) {
    /* Snap the floating orange button capsule tightly into the iPhone's bottom safe zone area tracks */
    .immich-map-fab {
        bottom: 24px !important;
        right: 24px !important;
        padding: 10px 18px !important;
        font-size: 12px !important;
    }

    .immich-map-fab:hover {
        transform: none !important; /* Disables mouse-hover lift transforms on mobile touchscreen devices */
    }
}
