/* Material Design Overrides for home.smilak.com */

/* Root variables for Material Design theme */
:root {
    /* Material Design Colors */
    --mdc-theme-primary: #1976d2;
    --mdc-theme-secondary: #4CAF50;
    --mdc-theme-error: #f44336;
    --mdc-theme-surface: #ffffff;
    --mdc-theme-background: #fafafa;
    --mdc-theme-on-primary: #ffffff;
    --mdc-theme-on-secondary: #ffffff;
    --mdc-theme-on-surface: rgba(0, 0, 0, 0.87);
    
    /* Typography */
    --mdc-typography-font-family: 'Roboto', sans-serif;
}

/* Dark theme overrides */
body.dark-theme {
    --mdc-theme-surface: #1e1e1e;
    --mdc-theme-background: #121212;
    --mdc-theme-on-surface: rgba(255, 255, 255, 0.87);
}

/* Base typography */
body {
    font-family: var(--mdc-typography-font-family);
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

/* Convert existing buttons to Material Design */
button, .button, input[type="submit"], input[type="button"] {
    background-color: var(--mdc-theme-primary) !important;
    color: var(--mdc-theme-on-primary) !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 0 16px !important;
    height: 36px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.0892857143em !important;
    text-transform: uppercase !important;
    transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 
                0px 2px 2px 0px rgba(0, 0, 0, 0.14), 
                0px 1px 5px 0px rgba(0, 0, 0, 0.12) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover, .button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 
                0px 4px 5px 0px rgba(0, 0, 0, 0.14), 
                0px 1px 10px 0px rgba(0, 0, 0, 0.12) !important;
}

/* Text fields */
input[type="text"], input[type="password"], input[type="email"], textarea, select {
    font-family: var(--mdc-typography-font-family);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.009375em;
    border: 1px solid rgba(0, 0, 0, 0.38);
    border-radius: 4px;
    padding: 12px 16px;
    background-color: transparent;
    transition: border 0.15s;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--mdc-theme-primary);
    border-width: 2px;
}

/* Cards and surfaces */
.card, .panel, .info-box {
    background-color: var(--mdc-theme-surface);
    border-radius: 4px;
    box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 
                0px 1px 1px 0px rgba(0, 0, 0, 0.14), 
                0px 1px 3px 0px rgba(0, 0, 0, 0.12);
    border: none !important;
}

/* Hamburger menu conversion to Material Design */
.hamburger-button {
    background: transparent !important;
    border: none !important;
    color: var(--mdc-theme-on-surface) !important;
    width: 48px !important;
    height: 48px !important;
    padding: 12px !important;
    box-shadow: none !important;
    font-size: 24px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.hamburger-button:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
    box-shadow: none !important;
}

body.dark-theme .hamburger-button:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Menu content Material Design style */
.menu-content {
    box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, 0.2), 
                0px 16px 24px 2px rgba(0, 0, 0, 0.14), 
                0px 6px 30px 5px rgba(0, 0, 0, 0.12) !important;
    border-radius: 4px;
    background-color: var(--mdc-theme-surface);
}

.menu-content a {
    color: var(--mdc-theme-on-surface);
    padding: 8px 16px;
    height: 48px;
    display: flex;
    align-items: center;
    transition: background-color 0.15s;
}

.menu-content a:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

body.dark-theme .menu-content a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Flash messages Material Design style */
.flash-message {
    border-radius: 4px;
    padding: 14px 16px;
    font-size: 14px;
    border: none;
    box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 
                0px 6px 10px 0px rgba(0, 0, 0, 0.14), 
                0px 1px 18px 0px rgba(0, 0, 0, 0.12);
}

.flash-success {
    background-color: #4CAF50 !important;
    color: white !important;
    border: none !important;
}

.flash-error {
    background-color: #f44336 !important;
    color: white !important;
    border: none !important;
}

.flash-info {
    background-color: #2196F3 !important;
    color: white !important;
    border: none !important;
}

/* Material Design switch for theme toggle */
.theme-toggle-switch, .menu-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 14px;
}

.theme-toggle-switch input, .menu-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider, .menu-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.38);
    transition: .2s;
    border-radius: 14px;
}

.theme-toggle-slider:before, .menu-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: -2px;
    bottom: -3px;
    background-color: #fafafa;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 
                0px 1px 1px 0px rgba(0, 0, 0, 0.14), 
                0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

input:checked + .theme-toggle-slider,
input:checked + .menu-toggle-slider {
    background-color: rgba(33, 150, 243, 0.5);
}

input:checked + .theme-toggle-slider:before,
input:checked + .menu-toggle-slider:before {
    transform: translateX(20px);
    background-color: #2196F3;
}

/* Admin badge Material Design style */
.admin-badge {
    background-color: var(--mdc-theme-secondary) !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0.0333333333em !important;
    text-transform: uppercase !important;
}

/* Home page Material Design cards */
.home-link-card {
    width: 280px;
    margin: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.home-link-card:hover {
    transform: translateY(-4px);
}

.home-link-content {
    text-decoration: none;
    color: inherit;
    display: block;
}

.home-link-icon {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mdc-theme-primary);
    color: var(--mdc-theme-on-primary);
}

.home-link-icon i {
    font-size: 64px;
}

.mdc-card__content {
    padding: 16px;
}

.mdc-card__content h2 {
    margin: 0 0 8px 0;
}

.mdc-card__content p {
    margin: 0;
    color: var(--mdc-theme-on-surface);
    opacity: 0.6;
}

/* Main navigation header */
.main-navigation {
    display: flex;
    align-items: center;
    margin-left: 24px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--mdc-theme-on-surface);
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

.nav-item i {
    font-size: 20px;
    margin-right: 8px;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.0892857143em;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

body.dark-theme .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: var(--mdc-theme-primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background-color: var(--mdc-theme-primary);
}

/* Admin controls layout fix */
.admin-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Fix mobile scrolling */
@media (max-width: 768px) {
    body {
        overflow: auto !important;
        height: auto !important;
    }
    
    .main-container {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
    }
    
    .content-container {
        overflow-y: auto !important;
        height: auto !important;
        padding: 10px;
    }
}

/* Process status alignment fix */
.process-status-container {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
}

#process-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
    color: var(--mdc-theme-on-surface);
    opacity: 0.7;
}

/* Material Design Linear Progress customization */
#motion-progress-bar {
    --mdc-theme-primary: #4CAF50;
}

/* Enhanced menu styling */
.menu-item-with-icon {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 12px 16px !important;
}

.menu-item-with-icon i {
    font-size: 20px;
    color: var(--mdc-theme-on-surface);
    opacity: 0.7;
}

.menu-item-with-icon:hover i {
    opacity: 1;
}

.menu-toggle-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px !important;
    border-top: none !important;
}

.menu-toggle-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-content i {
    font-size: 20px;
    color: var(--mdc-theme-on-surface);
    opacity: 0.7;
}

.user-info {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 16px !important;
    background-color: rgba(0, 0, 0, 0.03) !important;
    margin: 0 !important;
}

body.dark-theme .user-info {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.user-info i {
    font-size: 40px;
    color: var(--mdc-theme-primary);
}

.user-info-text {
    flex: 1;
}

.user-info-text p {
    margin: 0 !important;
    font-weight: 500;
    font-size: 16px;
    color: var(--mdc-theme-on-surface);
    padding: 0 !important;
}

/* Menu separator Material Design */
.menu-separator {
    height: 1px !important;
    background-color: rgba(0, 0, 0, 0.12) !important;
    margin: 8px 0 !important;
}

body.dark-theme .menu-separator {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

/* Material Design FAB positioning */
.mdc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.mdc-fab--extended {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

#video-actions-fab {
    background-color: var(--mdc-theme-secondary);
}

#add-favorite-fab {
    background-color: var(--mdc-theme-primary);
}

/* Responsive navigation */
@media (max-width: 768px) {
    .main-navigation {
        margin-left: 8px;
    }
    
    .nav-item {
        padding: 8px;
        margin: 0 2px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        margin-right: 0;
        font-size: 24px;
    }
    
    .nav-item.active::after {
        left: 8px;
        right: 8px;
    }
}