/**
 * Homepage - Warm Welcome
 * The front door. Warm dark card, no gimmicks, simple and inviting.
 * @version 8.0.0
 */

/* =============================================================================
   BASE LAYOUT
   ============================================================================= */

html, body {
    height: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
    margin: 0;
    background-color: #f5f5f3;
    position: relative;
    overscroll-behavior-y: auto;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../../images/backgrounds/forest_ghibli.webp");
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: -1;
    transition: background-image 0.5s ease;
}

body.real-mode::before {
    background-image: url("../../images/trees-ghibli.svg");
}

/* =============================================================================
   THEME TOGGLE
   ============================================================================= */

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background-color: rgb(0 0 0 / 70%);
    border-radius: 40px;
    padding: 5px;
    border: 2px solid rgb(255 255 255 / 30%);
    box-shadow: 0 0 15px rgb(0 0 0 / 30%), 0 0 5px rgb(255 255 255 / 10%);
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.theme-toggle:hover {
    border-color: rgb(255 255 255 / 50%);
    box-shadow: 0 0 20px rgb(0 0 0 / 40%), 0 0 10px rgb(255 255 255 / 20%);
}

.theme-toggle button {
    background-color: rgb(0 0 0 / 80%);
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 30px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 80px;
    height: 36px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle button:hover {
    background-color: rgb(0 0 0 / 70%);
}

.theme-toggle button:active {
    transform: translateY(0);
}

.theme-toggle button .toggle-icon {
    font-size: 20px;
    position: absolute;
    transition: all 0.3s ease;
    z-index: 2;
}

.theme-toggle button .ghibli-icon {
    left: 10px;
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgb(255 255 255 / 50%);
}

.theme-toggle button .real-icon {
    right: 10px;
    opacity: 0.5;
}

.theme-toggle button .toggle-slider {
    width: 28px;
    height: 28px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    left: 4px;
    box-shadow: 0 2px 5px rgb(0 0 0 / 20%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1;
}

body.real-mode .theme-toggle button .toggle-slider {
    transform: translateX(44px);
}

body.real-mode .theme-toggle button .ghibli-icon {
    opacity: 0.5;
    transform: scale(1);
    text-shadow: none;
}

body.real-mode .theme-toggle button .real-icon {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgb(255 255 255 / 50%);
}

.theme-toggle .toggle-label {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgb(0 0 0 / 60%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.theme-toggle:hover .toggle-label {
    opacity: 1;
}

/* =============================================================================
   MAIN CARD
   ============================================================================= */

.card {
    width: 100%;
    max-width: 500px;
    max-height: 95vh;
    background: linear-gradient(180deg, #1E1C19 0%, #141310 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgb(120 100 60 / 12%);
    position: relative;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.card-image {
    width: 100%;
    height: 280px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

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

/* =============================================================================
   CARD CONTENT
   ============================================================================= */

.card-content {
    padding: 15px;
    color: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   HERO — title/description left, profile right
   ============================================================================= */

.card-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.card-hero-text {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}

.card-description {
    font-size: 16px;
    color: #b0b0a8;
    font-weight: 400;
}

/* =============================================================================
   PROFILE — right side of hero
   ============================================================================= */

.profile-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.profile-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-info p {
    font-size: 14px;
    white-space: nowrap;
}

.profile-tagline {
    font-size: 12px;
    color: #8a8a82;
    font-weight: 400;
}

/* =============================================================================
   NAVIGATION BUTTONS
   ============================================================================= */

.nav-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.nav-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    font-size: 15px;
}

/* =============================================================================
   DATA MANAGEMENT — single row of quiet tools
   ============================================================================= */

.data-management-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1.5px dashed rgb(255 255 255 / 10%);
    display: flex;
    gap: 8px;
}

/* Shared base — warm monochrome, emoji icons do the talking */
.dev-preview-btn,
.data-center-btn,
.infra-btn,
.delete-data-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-decoration: none;
    background: #23201A;
    border: 1.5px solid rgb(232 168 56 / 8%);
    color: rgb(255 255 255 / 50%);
}

/* Delete button — subtle warm red tint */
.delete-data-btn {
    background: #231A1A;
    border-color: rgb(255 107 107 / 10%);
}

/* Icons */
.dev-preview-icon,
.data-center-icon,
.infra-icon,
.delete-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Text */
.dev-preview-text,
.data-center-text,
.infra-text,
.delete-text {
    white-space: nowrap;
}

/* Hover — gentle warmth */
@media (hover: hover) {
    .dev-preview-btn:hover,
    .data-center-btn:hover,
    .infra-btn:hover {
        background: #2A261E;
        border-color: rgb(232 168 56 / 15%);
        color: rgb(255 255 255 / 65%);
    }

    .delete-data-btn:not(.success):hover {
        background: #2A1E1E;
        border-color: rgb(255 107 107 / 18%);
        color: rgb(255 255 255 / 65%);
    }
}

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

@media (hover: hover) {
    .delete-data-btn:disabled:hover {
        background: #231A1A;
        border-color: rgb(255 107 107 / 10%);
        color: rgb(255 255 255 / 50%);
    }
}

/* Delete success state */
.delete-data-btn.success {
    background: rgb(76 175 80 / 10%);
    border-color: rgb(76 175 80 / 20%);
    color: #4caf50;
    overflow: visible;
}

.delete-data-btn.success .delete-icon,
.delete-data-btn.success .delete-text {
    display: inline-block;
    flex-shrink: 0;
}

@media (hover: hover) {
    .delete-data-btn.success:hover {
        background: rgb(76 175 80 / 15%);
        border-color: #4caf50;
    }
}

.delete-data-btn.success:active {
    transform: none;
    box-shadow: none;
}

/* Dots animation for success state */
.dots-container {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 26px;
}

.dot {
    width: 6px !important;
    height: 6px !important;
    background: #4caf50 !important;
    border-radius: 50%;
    display: block !important;
    opacity: 1;
    transition: opacity 0.5s ease;
    flex-shrink: 0;
    visibility: visible !important;
    position: relative;
    z-index: 10;
}

.dot.fade {
    opacity: 0;
}

/* =============================================================================
   CARD FOOTER
   ============================================================================= */

.card-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-top: 1px dashed rgb(255 255 255 / 8%);
    color: #7a7a72;
    font-size: 13px;
    flex-shrink: 0;
}

.brand {
    font-weight: 400;
}

.services {
    display: flex;
    gap: 10px;
}

.services span {
    position: relative;
}

.services span:not(:last-child)::after {
    content: "+";
    position: absolute;
    right: -8px;
    color: #444;
}

/* =============================================================================
   HEADER TITLE
   ============================================================================= */

.header-title {
    font-size: 18px;
    font-weight: 500;
}

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

@media (height <= 600px) {
    .card-image {
        height: 150px;
    }

    .card-content {
        padding: 12px;
    }

    .card-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .card-description {
        margin-bottom: 10px;
    }

    .card-footer {
        padding: 10px 12px;
    }
}

@media (width <= 420px) {
    .card-content > div:last-child {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        height: 100vh !important;
        height: 100dvh !important;
        padding-top: 80px !important;
        padding-bottom: 20px !important;
        box-sizing: border-box !important;
        align-items: flex-start !important;
    }

    .card {
        max-height: calc(100vh - 20px);
        margin: 20px auto 0;
        width: calc(100% - 20px);
    }

    .card-image {
        height: 200px;
    }

    .card-content {
        padding: 20px;
    }

    .card-title {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .card-description {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .nav-buttons {
        display: flex !important;
        gap: 8px !important;
    }

    .cta-button,
    .btn {
        width: 100%;
        white-space: nowrap;
        padding: 12px 8px;
        font-size: 14px;
    }

    .card-hero {
        gap: 12px;
        margin-bottom: 16px;
    }

    .profile-image {
        width: 42px;
        height: 42px;
        margin-right: 10px;
    }

    .profile-info p {
        font-size: 13px;
    }

    .profile-tagline {
        font-size: 11px;
    }

    .card-footer {
        padding: 10px 20px;
        font-size: 12px;
    }

    .services {
        gap: 8px;
    }

    .services span:not(:last-child)::after {
        right: -6px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
    }

    .theme-toggle button {
        width: 70px;
        height: 44px;
    }

    .theme-toggle button .toggle-slider {
        width: 36px;
        height: 36px;
    }

    body.real-mode .theme-toggle button .toggle-slider {
        transform: translateX(30px);
    }

    .data-management-section {
        gap: 6px;
    }

    .data-management-section > a,
    .data-management-section > button {
        padding: 8px 4px !important;
        font-size: 12px;
        text-decoration: none !important;
        margin-left: 0 !important;
    }

    .delete-data-btn.success {
        padding: 8px 4px;
        font-size: 12px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 3px;
    }

    .delete-data-btn.success .delete-icon,
    .delete-data-btn.success .delete-text,
    .delete-data-btn.success .dots-container {
        display: inline-flex !important;
        flex-shrink: 0;
    }

    .dots-container {
        margin-left: 4px;
    }
}

/* On very narrow screens, hide management text — icons only */
@media (max-width: 380px) {
    .dev-preview-text,
    .data-center-text,
    .infra-text,
    .delete-text {
        display: none;
    }
}

/* Fix adjacent-sibling margin from accessibility-mobile.css */
@media (max-width: 768px) {
    .data-management-section a + a {
        margin-left: 0 !important;
    }
}
