/* ============================================================
   SDOM.APP - STYLESHEET HOME.PHP (PULITO)
   ============================================================ */

/*
:root {
    --primary-bg: #0C0C0C;
    --card-bg: #141414;
    --accent: #FF6900;
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #333;
}
*/

:root {    
    --primary-bg: #27272a;
    --accent: #FF6900;
    --text-light: #F8FAFC;

    --bg-color: #27272a;
    --card-bg: #27272a;
    --accent-orange: #ff9f2e;
    --status-red: #ef4444;
    --status-green: #22c55e;
    --status-yellow: #eab308;
    --status-ochre: #a37b01;   
    --text-main: #f4f4f5;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.08);
    --card-radius:18px;          /* arrotondamento generoso per le card principali */
    --pill-radius: 18px;         /* per barre pillolate tipo alert e slider allarme */
}


/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Exo 2', sans-serif;
    font-style: normal !important;
    /* Rimuove l'evidenziazione blu al tocco su Android/Chrome */
    -webkit-tap-highlight-color: transparent;
}


/* ===== RESET E BASE ===== */

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-light);
    line-height: 1.6;    
    /* padding-top: 70px !important; /* Spazio per navbar se presente */
}

/* ===== UTILITIES ===== */
.text-light { color: var(--text-light) !important; }
.text-warning { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.opacity-75 { opacity: 0.75 !important; }
.bg-black { background-color: #000 !important; }

/* ===== HERO SECTION ===== */
.hero-section-compact {
    background: #0C0C0C;
    padding: 2.5rem 0 !important;
    text-align: center;
}
.hero-section-compact h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}
.hero-section-compact p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn-hex {
    background: #FF6900;
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-hex:hover {
    background: #E55E00;
    transform: translateY(-1px);
}
.btn-outline-light:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== SERVICE CARDS ===== */
.card-service-left {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 110px;
}
.card-service-left:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.card-icon-left {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255, 105, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 105, 0, 0.2);
}
.card-icon-left i { font-size: 1.5rem; color: var(--accent); }
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}
.card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ===== FORM CONTATTI ===== */
.form-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
}
.form-input {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 8px;
    padding: 0.75rem;
    width: 100%;
}
.form-input:focus {
    background: var(--primary-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 105, 0, 0.1);
    color: #fff;
    outline: none;
}
.form-check-input {
    background-color: var(--primary-bg);
    border-color: #555;
}
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
/* ===== FOOTER ===== */
footer {
    background-color: #000 !important;
    padding: 1.5rem 0 !important;
    border-top: 1px solid var(--border-color);
}

.footer-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.footer-logo-small {
    height: 32px;
    width: auto;
}

.footer-logo-icon {
    height: 24px;
    width: auto;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer-link:hover {
    color: var(--accent) !important;
}

/* Responsive Footer per Mobile */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-left, .footer-right {
        justify-content: center;
    }
}

/* ===== NAVBAR (top.php) ===== */
.navbar-top {
    height: 70px !important;
    background-color: var(--primary-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

/* Stile Link Navbar Desktop */
.navbar-top .nav-link,
.navbar-top .top-bar-item {
    color: var(--text-muted) !important;
    transition: color 0.2s ease;
    font-weight: 500;
}

.navbar-top .nav-link:hover,
.navbar-top .top-bar-item:hover,
.navbar-top .nav-link.active {
    color: var(--accent) !important;
}

/* Loghi (Usati sia nella Navbar che nella Hero) */
.sdom-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sdom-logo-img.loghetto {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.sdom-logo-img.logo-main {
    width: auto;
    height: 20px !important;
    object-fit: contain;
}

/* ===== MENU MOBILE (Offcanvas) ===== */
.offcanvas.bg-black {
    background-color: var(--card-bg) !important;
    border-left: 1px solid var(--border-color);
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-body .nav-link {
    color: var(--text-light) !important;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1.1rem;
    transition: all 0.2s;
}

.offcanvas-body .nav-link:hover,
.offcanvas-body .nav-link.active {
    color: var(--accent) !important;
    background: rgba(255, 105, 0, 0.05);
    padding-left: 1.8rem; /* Piccolo effetto di scorrimento al tocco */
}

/* Responsive per i loghi su schermi piccoli */
@media (max-width: 576px) {
    .sdom-logo-img.loghetto {
        width: 35px;
        height: 35px;
    }
    .sdom-logo-img.logo-main {
        height: 24px !important;
    }
}

/* ===== COMPONENTI CONDIVISI DASHBOARD (Card e Griglie) ===== */
.glass-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius, 16px);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.alert-bar {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.alert-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.grid-custom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: auto; /* Se la card è alta, spinge i pulsanti in basso */
}

.custom-btn {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-icon-box {
    margin: 0;
}

.btn-icon-box i {
    font-size: 1.8rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

/* Su mobile riduciamo leggermente lo spazio ma teniamo 3 pulsanti in fila */
@media (max-width: 576px) {
    .grid-custom { gap: 0.5rem; }
    .custom-btn { padding: 1rem 0.5rem; }
}


.app-container {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
}

header {
    padding: 20px 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.content-container {
    width: 100%;
    padding: 0 24px;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Stili responsive per desktop */
@media (min-width: 421px) {
    .app-container {
        max-width: 100%;
        border-left: none;
        border-right: none;
        box-shadow: none;
        background-color: var(--card-bg);
    }

    body {
        background-color: var(--card-bg);
    }

    header {
        display: flex;
        justify-content: center;
        padding: 20px 24px 10px;
    }

    .header-content {
        width: 100%;
        max-width: 900px; 
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .content-container {
        max-width: 900px; 
        padding: 0 24px;
    }

    .content {
        padding: 10px 24px 40px;
    }
}


/* Card Clima */
.thermostat-card,
.target-box {
    border-radius: var(--card-radius) !important;
}

/* Alert "Porta Garage Aperta" */
.alert-bar {
    border-radius: var(--pill-radius) !important;
    padding: 14px 20px;
}


.menu-btn {
    background: rgba(255, 159, 46, 0.15);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    right: 10px;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-main);
}


/* Bonus: rendi coerenti anche le altre card che usi spesso */
.glass-card,
.meteo-card,
.section-header,
.grid-custom .custom-btn {
    border-radius: var(--card-radius) !important;
}