/* GTS V45 STEEL: Logic moved to main-view.php for absolute reliability. */
#v45-v-root { display: block; }

/* Force clean background on main plugin wrappers to hide theme patterns */
#g-main-wrapper, .g-app-container, body.gym-pro-page {
    background-color: #0f172a !important;
    background-image: none !important;
}

/* Fullscreen Modes for Yearly Plan */
.gmonth-max {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 9999999 !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
}

.gweek-max {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 99999999 !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
    background: #0f172a !important;
}

/* Dynamic Grid Classes for Yearly Plan */
.ggrid-auto {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
}
.ggrid-2col {
    grid-template-columns: repeat(2, 1fr) !important;
}
@media (max-width: 768px) {
    .ggrid-2col { grid-template-columns: 1fr !important; }
}
.ggrid-1col {
    grid-template-columns: 1fr !important;
}

/* Weeks Grid Container */
.gweeks-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 0;
    width: 100%;
}

.gweek-card {
    height: auto;
    flex: 1 1 calc(25% - 20px);
    min-width: 250px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* Training Unit Exercises Toggle */
.gunit-exs {
    display: none !important;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding-top: 8px;
}
.gweek-max .gunit-exs {
    display: flex !important;
}

/* Weekly Grid Toggle */
.gweekly-grid {
    display: none !important;
}
.gweek-max .gweekly-grid {
    display: block !important;
}
.gweek-max .gweek-compact-tags {
    display: none !important;
}

/* Auto-expanding Week Textarea */
.gweek-card textarea {
    min-height: 45px;
    height: auto;
    border: 1px dashed rgba(255,255,255,0.1) !important;
    background: transparent !important;
    padding: 8px !important;
    border-radius: 8px !important;
    transition: all 0.3s;
}
.gweek-max textarea {
    min-height: 100px !important;
    white-space: pre-wrap !important;
    overflow-y: auto !important;
    border: 1px solid rgba(139,92,246,0.3) !important;
    background: rgba(15,23,42,0.5) !important;
}




/* Styling for exercise cards in weekly grid to prevent theme conflicts */
.exercise-card-mini {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(30, 41, 59, 0.7) !important;
    padding: 10px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s !important;
    width: 110px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.exercise-card-mini img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    display: block !important;
    margin: 0 !important;
    padding: 2px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    border: none !important;
}

.exercise-card-mini button {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    cursor: pointer !important;
    transition: 0.2s !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.exercise-card-mini button:hover {
    background: rgba(16, 185, 129, 0.8) !important;
}

/* Force TinyMCE icons to use Font Awesome as a foolproof fallback */
.mce-i-bold:before { content: "\f032" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-italic:before { content: "\f033" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-bullist:before { content: "\f0ca" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-numlist:before { content: "\f0cb" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-blockquote:before { content: "\f10e" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-alignleft:before { content: "\f036" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-aligncenter:before { content: "\f037" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-alignright:before { content: "\f038" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-link:before { content: "\f0c1" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-wp_more:before { content: "\f141" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-spellchecker:before { content: "\f14a" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-fullscreen:before { content: "\f065" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-wp_adv:before { content: "\f11c" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-strikethrough:before { content: "\f0cc" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-hr:before { content: "\f068" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-forecolor:before { content: "\f53f" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-pastetext:before { content: "\f0ea" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-removeformat:before { content: "\f12d" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-charmap:before { content: "\f155" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-outdent:before { content: "\f03b" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-indent:before { content: "\f03c" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-undo:before { content: "\f0e2" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-redo:before { content: "\f01e" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-ltr:before { content: "\f036" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-rtl:before { content: "\f038" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }
.mce-i-wp_help:before { content: "\f059" !important; font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; }

/* Custom Opacity Slider */
#muscle-opacity-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #1e293b;
    border-radius: 5px;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
    margin-top: 10px;
    margin-bottom: 5px;
}

#muscle-opacity-slider:hover {
    opacity: 1;
}

#muscle-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.6);
    border: 2px solid #fff;
}

#muscle-opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.6);
    border: 2px solid #fff;
    border-radius: 50%;
}

/* Responsive Styles for Weekly Planner */
@media (max-width: 768px) {
    .gweek-card {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .gweeks-container {
        gap: 10px;
    }
}

/* ========================================================= */
/* GLASSMORPHISM & NEON UI - MODERN GLOBAL DESIGN (V5 FINAL) */
/* ========================================================= */

/* Main Glass Panel used for all full-screen containers */
.g-glass-panel {
    background: linear-gradient(135deg, rgba(30,41,59,0.5) 0%, rgba(15,23,42,0.85) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Glass Card for grid items, stats, and widgets */
.g-glass-card {
    background: linear-gradient(145deg, rgba(30,41,59,0.6), rgba(15,23,42,0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}

.g-glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.15);
}

/* Accent Borders for Glass Cards */
.g-glass-card.border-green { border-top: 3px solid rgba(16,185,129,0.7); }
.g-glass-card.border-blue { border-top: 3px solid rgba(56,189,248,0.7); }
.g-glass-card.border-purple { border-top: 3px solid rgba(139,92,246,0.7); }
.g-glass-card.border-orange { border-top: 3px solid rgba(245,158,11,0.7); }
.g-glass-card.border-red { border-top: 3px solid rgba(239,68,68,0.7); }
.g-glass-card.border-pink { border-top: 3px solid rgba(244,114,182,0.7); }

.g-glass-card:hover.border-green { box-shadow: 0 15px 35px rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); }
.g-glass-card:hover.border-blue { box-shadow: 0 15px 35px rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.4); }
.g-glass-card:hover.border-purple { box-shadow: 0 15px 35px rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); }
.g-glass-card:hover.border-orange { box-shadow: 0 15px 35px rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); }

/* Glow Background Blobs (Static for performance, light pseudo elements) */
.g-glow-blob {
    position: absolute !important;
    border-radius: 50%;
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}
.g-glow-blob.blue { background: rgba(56,189,248,0.15); }
.g-glow-blob.green { background: rgba(16,185,129,0.15); }
.g-glow-blob.purple { background: rgba(139,92,246,0.15); }
.g-glow-blob.pink { background: rgba(244,114,182,0.15); }

/* Neon Text Utilities */
.g-text-neon {
    color: #fff;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}
.g-text-glow-green { text-shadow: 0 0 12px rgba(16,185,129,0.4); color: #10b981; }
.g-text-glow-blue { text-shadow: 0 0 12px rgba(56,189,248,0.4); color: #38bdf8; }
.g-text-glow-purple { text-shadow: 0 0 12px rgba(139,92,246,0.4); color: #8b5cf6; }
.g-text-glow-pink { text-shadow: 0 0 12px rgba(244,114,182,0.4); color: #f472b6; }

/* Neon Button */
.g-btn-neon {
    background: linear-gradient(135deg, rgba(56,189,248,0.8) 0%, rgba(59,130,246,0.9) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 22px;
    border-radius: 12px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(56,189,248,0.25);
    font-family: 'Cairo', sans-serif;
}
.g-btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56,189,248,0.4);
    background: linear-gradient(135deg, rgba(56,189,248,0.95) 0%, rgba(59,130,246,1) 100%);
}
.g-btn-neon.green {
    background: linear-gradient(135deg, rgba(16,185,129,0.8) 0%, rgba(5,150,105,0.9) 100%);
    box-shadow: 0 4px 15px rgba(16,185,129,0.25);
}
.g-btn-neon.green:hover {
    box-shadow: 0 8px 25px rgba(16,185,129,0.4);
}

/* Specific Screen Enhancements */
.g-header-title {
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    color: #f8fafc;
    font-family: 'Cairo', sans-serif;
}

/* Ensure z-index is respected inside glass cards */
.g-glass-card > * { position: relative; z-index: 1; }
.g-glass-panel > * { position: relative; z-index: 1; }

@media (max-width: 768px) {
    .g-glass-panel { padding: 15px; border-radius: 16px; }
    .g-glass-card { padding: 15px; }
    .g-header-title { font-size: 1.8rem; }
}

/* Global Input & Select styling inside panels */
.g-glass-panel input, 
.g-glass-panel select, 
.g-glass-panel textarea,
.g-glass-card input, 
.g-glass-card select, 
.g-glass-card textarea {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.g-glass-panel input:focus, 
.g-glass-panel select:focus, 
.g-glass-panel textarea:focus,
.g-glass-card input:focus, 
.g-glass-card select:focus, 
.g-glass-card textarea:focus {
    border-color: rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2) !important;
    outline: none !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

/* Modals */
.gmodal-content {
    background: linear-gradient(135deg, rgba(30,41,59,0.8) 0%, rgba(15,23,42,0.95) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5) !important;
    border-radius: 24px !important;
}

/* ====== GLOBAL RESPONSIVENESS (MOBILE, IPAD, LAPTOP) ====== */
@media (max-width: 1024px) {
    .gpanel {
        padding: 10px !important;
    }
    .g-modal-content {
        width: 95% !important;
        padding: 15px !important;
        margin: 10px auto !important;
    }
    .gcard {
        margin-bottom: 15px !important;
    }
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    button {
        min-height: 44px !important; /* Touch targets for Apple/Android guidelines */
        padding: 10px 15px !important;
    }
}
@media (max-width: 768px) {
    #gfin-content-smart_analytics > div, 
    #gfin-content-overview > div {
        grid-template-columns: 1fr !important;
    }
    .g-stats-row {
        flex-direction: column !important;
    }
    .g-stat-box {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
}

/* Fix iOS scroll freeze for the main app area */
.g-content-wrap main {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
}
