/* ================================================
   EZ4ME Enhanced Styles - Modern Polish Edition
   Original Design Preserved with Modern Enhancements
   ================================================ */

/* Base Styles */
h6{page-break-before: always;}
html, body{height: 100%;}
html {
    display: table;
    margin: auto;
}
body {
    display: table-cell;
    vertical-align: middle;
    padding: 0px;
    margin: 0px;
    font-size: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    background-color: antiquewhite;
    background-image: url('../Images/BodyBG.png');
    background-position: top center;
    background-repeat: repeat;
    background-attachment: fixed;
}

/* Smooth Transitions */
* {
    box-sizing: border-box;
}

input, button, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Input Fields */
input[type="text"], input[type="number"], select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    outline: none;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: #5381B7;
    box-shadow: 0 0 0 3px rgba(83, 129, 183, 0.15), 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

input[type="text"]:hover, input[type="number"]:hover, select:hover {
    border-color: #b0b0b0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

/* Enhanced Buttons */
.Button, input[type="button"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: white;
    background: linear-gradient(135deg, #5381B7 0%, #4a73a5 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(83, 129, 183, 0.3);
    position: relative;
    overflow: hidden;
}

.Button:hover, input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(83, 129, 183, 0.4);
    background: linear-gradient(135deg, #5f8dc9 0%, #5381B7 100%);
}

.Button:active, input[type="button"]:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(83, 129, 183, 0.3);
}

.ButtonSave {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: white;
    background: linear-gradient(135deg, #003c68 0%, #002847 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 60, 104, 0.3);
}

.ButtonSave:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 60, 104, 0.4);
    background: linear-gradient(135deg, #004878 0%, #003c68 100%);
}

.LogoDiv {
    padding-top: 10px;
    text-align: center;
}

/* Enhanced Menu Items */
.MenuTD {
    vertical-align: top;
    background-image: url('../Images/Menu/Menu_Drawer_Down.png');
    background-size: 100% 60px;
    background-repeat: no-repeat;
    background-position: center bottom;
    padding: 25px 10px 0px 10px;
    margin: 0px;
    transition: all 0.3s ease;
    position: relative;
}

.MenuTD:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
}

.MenuTD::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #343089, transparent);
    transition: width 0.3s ease;
}

.MenuTD:hover::after {
    width: 80%;
}

.MenuTD A:link, .MenuTD A:visited, .MenuTD A:hover {
    font-size: 14px;
    color: #343089;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
    transition: color 0.3s ease;
}

.MenuTD:hover A {
    color: #5381B7;
}

.MenuTDSelected {
    vertical-align: top;
    background-image: url('../Images/Menu/Menu_Drawer_Up.png');
    background-size: 100% 60px;
    background-repeat: no-repeat;
    background-position: center bottom;
    padding: 15px 10px 0px 10px;
    margin: 0px;
    animation: drawerPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes drawerPop {
    0% { transform: translateY(10px); opacity: 0; }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); opacity: 1; }
}

.MenuTDSelected A:link, .MenuTDSelected A:visited, .MenuTDSelected A:hover {
    font-size: 14px;
    font-weight: bold;
    color: #343089;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
}

.SubMenuTD {
    height: 30px;
    vertical-align: top;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-bottom: 1px solid grey;
    border-right: 1px solid grey;
    padding: 0px 10px 0px 10px;
    margin: 0px;
    transition: all 0.2s ease;
}

.SubMenuTD:hover {
    background-color: rgba(83, 129, 183, 0.05);
    border-color: #5381B7;
}

.SubMenuTD A:link, .SubMenuTD A:visited, .SubMenuTD A:hover {
    font-size: 14px;
    color: #343089;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
}

.CategoryA:link, .CategoryA:visited, .CategoryA:hover {
    white-space: nowrap;
    font-size: 18px;
    color: #343089;
    text-decoration: none;
    transition: color 0.3s ease;
}

.CategoryA:hover {
    color: #5381B7;
}

.SubMenuTDSelected {
    height: 30px;
    vertical-align: top;
    border-top: 2px solid grey;
    border-left: 2px solid grey;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    padding: 0px 10px 0px 10px;
    margin: 0px;
    background-color: rgba(83, 129, 183, 0.1);
}

.SubMenuTDSelected A:link, .SubMenuTDSelected A:visited, .SubMenuTDSelected A:hover {
    font-size: 14px;
    font-weight: bold;
    color: #343089;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
}

.SubMenuNoBorderTD {
    height: 30px;
    vertical-align: top;
    padding: 0px 10px 0px 10px;
    margin: 0px;
}

.SubMenuNoBorderTD A:link, .SubMenuNoBorderTD A:visited, .SubMenuNoBorderTD A:hover {
    font-size: 14px;
    color: #343089;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
}

.PageNumberDiv {
    height: 50px;
    width: 716px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    background: linear-gradient(135deg, #666 0%, #888 100%);
    padding-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.PageNumberDivLast {
    height: 30px;
    width: 716px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    background: linear-gradient(135deg, #666 0%, #888 100%);
    padding-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #ffcdd2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.delete-btn:hover {
    background: #ffebee;
    border-color: #ef5350;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.2);
}

.delete-btn:active {
    transform: translateY(0);
}

.delete-icon {
    width: 18px;
    height: 18px;
    fill: #e53935;
    transition: transform 0.3s ease;
}

.delete-btn:hover .delete-icon {
    transform: rotate(90deg);
}

/* Drawer Designer Enhanced Styles */
.drawer-designer-header {
    background: linear-gradient(135deg, #5381B7 0%, #343089 100%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 4px 20px rgba(52, 48, 137, 0.3);
    animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drawer-canvas {
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.drawer-canvas:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Icon Buttons Enhanced */
input[type="button"][title="Delete"],
input[type="button"][title="Full Screen"] {
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

input[type="button"][title="Delete"]:hover {
    background-color: rgba(239, 83, 80, 0.2);
    border-color: #ef5350;
    transform: scale(1.1) rotate(90deg);
}

input[type="button"][title="Full Screen"]:hover {
    background-color: rgba(83, 129, 183, 0.2);
    border-color: #5381B7;
    transform: scale(1.1);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Image Hover Effects */
img {
    transition: transform 0.3s ease;
}

a:hover img {
    transform: scale(1.02);
}

/* Header Enhancement */
.MenuTop {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.05);
}

/* Select Dropdown Enhancement */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23343089' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

/* ================================================
   Layout & Visibility Fixes
   ================================================ */

/* Fix drawer canvas stacking - use display instead of visibility */
.drawer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.drawer-canvas.active,
.drawer-canvas[style*="visibility:visible"],
.drawer-canvas[style*="visibility: visible"] {
    display: block !important;
    position: relative;
}

/* Fix for inline visibility styles - override with proper display */
#Div_D1T1, #Div_D1T2, #Div_D1T3, #Div_D1T4, #Div_D1T5, #Div_D1T6 {
    position: relative;
}

/* Fix tab container */
.drawer-tabs-content {
    position: relative;
    min-height: 700px;
}

/* ================================================
   Spacing & Proportion Fixes
   ================================================ */

/* Fix excessive spacing in tables */
table.MenuTop {
    margin: 0 auto;
    table-layout: auto;
}

table.MenuTop td {
    vertical-align: bottom;
}

/* Fix spacer images - limit their impact */
img[src*="t.gif"] {
    max-width: 60px;
    height: auto !important;
}

/* Fix header inputs spacing */
.drawer-designer-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px !important;
    min-height: 70px;
    height: auto !important;
}

.drawer-designer-header label {
    white-space: nowrap;
}

.drawer-designer-header input[type="text"],
.drawer-designer-header input[type="number"] {
    width: auto;
    min-width: 60px;
    max-width: 200px;
}

/* Fix button row spacing */
.drawer-designer-header input[type="button"] {
    flex-shrink: 0;
}

/* ================================================
   Menu Tab Fixes
   ================================================ */

.MenuTD table,
.MenuTDSelected table {
    width: 100%;
    table-layout: fixed;
}

.MenuTD table td,
.MenuTDSelected table td {
    vertical-align: middle;
}

/* Emoji sizing in menus */
.MenuTD table td:first-child,
.MenuTDSelected table td:first-child {
    width: 40px !important;
    text-align: center;
}

/* ================================================
   Responsive Enhancements
   ================================================ */

@media (max-width: 1200px) {
    .drawer-designer-header {
        padding: 12px 15px !important;
    }
    
    .drawer-designer-header input[type="text"] {
        width: 150px !important;
    }
    
    .drawer-designer-header input[type="number"] {
        width: 50px !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .MenuTD, .MenuTDSelected {
        padding: 15px 5px 0px 5px;
    }
    
    .MenuTD table td:first-child,
    .MenuTDSelected table td:first-child {
        font-size: 20px !important;
        padding: 0 3px !important;
    }
    
    .MenuTD table td:last-child,
    .MenuTDSelected table td:last-child {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    
    input[type="text"], input[type="number"] {
        font-size: 14px;
    }
    
    /* Fix drawer header on mobile */
    .drawer-designer-header {
        flex-direction: column;
        gap: 8px;
        padding: 10px !important;
    }
    
    .drawer-designer-header > * {
        width: 100%;
        text-align: center;
    }
    
    .drawer-designer-header input[type="text"],
    .drawer-designer-header input[type="number"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Hide spacers on mobile */
    img[src*="t.gif"][width="60"],
    img[src*="t.gif"][width="40"] {
        width: 10px !important;
    }
}

@media (max-width: 480px) {
    .MenuTD, .MenuTDSelected {
        padding: 10px 3px 0px 3px;
    }
    
    .MenuTD table td:first-child,
    .MenuTDSelected table td:first-child {
        font-size: 18px !important;
        width: 30px !important;
    }
    
    .MenuTD table td:last-child,
    .MenuTDSelected table td:last-child {
        font-size: 10px !important;
    }
    
    .drawer-canvas {
        height: auto !important;
        min-height: 400px;
        padding: 10px !important;
    }
}
