/*
Theme Name: RisKass Theme
Theme URI: https://riskass.com
Author: RisKass Team
Author URI: https://riskass.com
Description: Tema WordPress personalizzato per RisKass con header e menu replicati dal prototipo
Version: 1.0
License: GPL v2 or later
Text Domain: riskass-theme
*/

/* Reset e variabili CSS dal prototipo */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Microsoft 365 Colors with Purple theme */
    --primary-purple: #5B2C6F;
    --primary-purple-light: #E1BEE7;
    --primary-purple-lighter: #F3E8F5;
    --ms-blue: #E3F2FD;
    --ms-blue-dark: #0078D4;
    --ms-teal: #B2DFDB;
    --ms-teal-dark: #00897B;
    --ms-orange: #FFE0B2;
    --ms-orange-dark: #E65100;
    --ms-pink: #F8BBD0;
    --ms-pink-dark: #C2185B;
    --ms-green: #DCEDC8;
    --ms-green-dark: #558B2F;
    --ms-yellow: #FFF9C4;
    --ms-yellow-dark: #F57C00;
    
    /* Light Theme */
    --background: #FAF9F8;
    --surface: #FFFFFF;
    --text-primary: #323130;
    --text-secondary: #605E5C;
    --text-tertiary: #A19F9D;
    --border-light: #EDEBE9;
    --border-subtle: #F3F2F1;
    --hover-light: #F3F2F1;
    --shadow-sm: 0 1.6px 3.6px 0 rgba(0,0,0,.132), 0 0.3px 0.9px 0 rgba(0,0,0,.108);
    --shadow-md: 0 6.4px 14.4px 0 rgba(0,0,0,.132), 0 1.2px 3.6px 0 rgba(0,0,0,.108);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --font-size-xxxl: 32px;
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Dark Theme Microsoft 365 */
[data-theme="dark"] {
    /* Dark theme colors */
    --background: #1F1F1F;
    --surface: #2D2D30;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --text-tertiary: #B0B0B0;
    --border-light: #3E3E42;
    --border-subtle: #333333;
    --hover-light: #404040;
    --shadow-sm: 0 1.6px 3.6px 0 rgba(0,0,0,.4), 0 0.3px 0.9px 0 rgba(0,0,0,.3);
    --shadow-md: 0 6.4px 14.4px 0 rgba(0,0,0,.5), 0 1.2px 3.6px 0 rgba(0,0,0,.4);
    
    /* Enhanced pastels for dark theme */
    --ms-blue: #E3F2FD;
    --ms-blue-dark: #1565C0;
    --ms-purple: #E1BEE7;
    --ms-purple-dark: #4A148C;
    --ms-teal: #B2DFDB;
    --ms-teal-dark: #00695C;
    --ms-orange: #FFE0B2;
    --ms-orange-dark: #E65100;
    --ms-pink: #F8BBD0;
    --ms-pink-dark: #AD1457;
    --ms-green: #DCEDC8;
    --ms-green-dark: #2E7D32;
    --ms-yellow: #FFF9C4;
    --ms-yellow-dark: #F57C00;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 14px;
}

/* Header Microsoft Style */
.ms-header {
    background-color: var(--surface);
    height: 48px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.app-launcher {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.app-launcher:hover {
    background-color: var(--hover-light);
}

.waffle-icon {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 3px;
}

.waffle-dot {
    width: 4px;
    height: 4px;
    background-color: var(--text-secondary);
    border-radius: 1px;
}

.app-logo {
    height: 26px;
    margin-left: 16px;
    margin-right: 8px;
}

.app-tag {
    background-color: var(--primary-purple);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-badge {
    background-color: var(--ms-orange-dark);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    color: var(--text-secondary);
    font-size: 16px;
}

.header-btn:hover {
    background-color: var(--hover-light);
}

.header-btn .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 4px;
    background-color: var(--ms-pink-dark);
    color: white;
    font-size: 10px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.profile-dropdown {
    position: relative;
    margin-left: 8px;
}

.profile-btn {
    width: 32px;
    height: 32px;
    background-color: var(--primary-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-btn:hover {
    background-color: var(--primary-purple-light);
    color: var(--primary-purple);
}

/* Profile Dropdown Menu */
.profile-menu {
    position: absolute;
    top: calc(100% + 3px);
    right: 0;
    width: 280px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: none;
    overflow: hidden;
    z-index: 1000;
}

.profile-dropdown:hover .profile-menu {
    display: block;
}

.profile-menu-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--hover-light);
}

.profile-menu-avatar {
    width: 48px;
    height: 48px;
    background-color: var(--primary-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.profile-menu-info {
    flex: 1;
}

.profile-menu-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.profile-menu-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-menu-divider {
    height: 1px;
    background: var(--border-light);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color var(--transition-fast);
}

.profile-menu-item:hover {
    background-color: var(--hover-light);
    text-decoration: none;
    color: var(--text-primary);
}

.profile-menu-item i {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Microsoft Sidebar */
.ms-sidebar {
    width: 220px;
    background-color: var(--hover-light);
    position: fixed;
    top: 48px;
    left: 0;
    height: calc(100vh - 48px);
    overflow-y: auto;
    z-index: 100;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background-color: var(--border-subtle);
}

.nav-item.active {
    background-color: var(--surface);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--ms-blue-dark);
}

.nav-icon {
    font-size: 16px;
    margin-right: 12px;
    color: var(--text-secondary);
}

.nav-item.active .nav-icon {
    color: var(--ms-blue-dark);
}

.nav-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 12px 0;
}

/* Section titles in sidebar */
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    padding: 8px 24px 4px;
    margin-top: 4px;
}

/* Main Content Area */
.main-content {
    margin-left: 220px;
    padding-top: 48px;
    min-height: 100vh;
    background-color: var(--background);
}

.content-wrapper {
    padding: var(--spacing-lg);
}

/* Hide default page titles */
.page-title,
.entry-title {
    display: none !important;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .ms-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }

    .ms-sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .app-tag, .admin-badge {
        display: none;
    }

    .ms-header {
        padding: 0 16px;
    }
}

/* Overlay for mobile menu */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-overlay {
        display: none;
    }
    
    .ms-sidebar.mobile-open ~ .mobile-overlay {
        display: block;
    }
}