/* Custom responsive styles for Indico */

/* ===== RESPONSIVE GRID SYSTEM ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-6 { flex: 0 0 50%; }
.col-12 { flex: 0 0 100%; }

/* ===== RESPONSIVE TABLES ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* ===== RESPONSIVE FORMS ===== */
.form-group {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.form-label {
    flex: 0 0 100%;
    margin-bottom: 0.5rem;
}

.form-field {
    flex: 1 1 100%;
}

.i-form.horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE BUTTONS ===== */
.i-button {
    white-space: nowrap;
    margin-bottom: 0.5rem;
}

.toolbar .group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== RESPONSIVE LAYOUTS ===== */
.layout-side-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.menu-column {
    flex: 0 0 250px;
}

.content-column {
    flex: 1;
    min-width: 300px;
}

.banner-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.banner .title {
    flex: 1;
    min-width: 200px;
}

.header-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.header-right {
    flex: 1;
    min-width: 300px;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-menu-toggle,
.mobile-nav-toggle,
.session-bar-toggle {
    display: none;
    width: 100%;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    text-align: left;
    margin-bottom: 0.5rem;
}

/* ===== SIDE MENU MOBILE STYLES ===== */
.side-menu {
    position: relative;
}

.side-menu .menu-items.mobile-open {
    display: flex !important;
}

/* ===== GLOBAL MENU MOBILE STYLES ===== */
#global-menu-items.mobile-open {
    display: block !important;
}

/* ===== SESSION BAR MOBILE STYLES ===== */
.session-bar .toolbar.mobile-open {
    display: flex !important;
}

.session-bar .group {
    flex-wrap: wrap;
}

/* ===== ACTION BOXES ===== */
.action-box .section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* ===== IMAGE RESPONSIVENESS ===== */
img {
    max-width: 100%;
    height: auto;
}

.header-logo {
    max-height: 60px;
    width: auto;
}

/* ===== TOUCH FRIENDLY ELEMENTS ===== */
.i-button,
button,
[role="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on iOS form elements */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-size: 16px;
}

/* ===== MEDIA QUERIES ===== */

/* Tablet and below */
@media (max-width: 1024px) {
    .mobile-menu-toggle,
    .mobile-nav-toggle {
        display: block;
    }
    
    .menu-items:not(.mobile-open),
    #global-menu-items:not(.mobile-open) {
        display: none;
    }
    
    .layout-side-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .menu-column {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .header-right {
        min-width: auto;
        width: 100%;
    }
    
    .side-menu {
        margin-bottom: 1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Grid system */
    .col, 
    .col-1, 
    .col-2, 
    .col-3, 
    .col-4, 
    .col-6 {
        flex: 0 0 100%;
        margin-bottom: 1rem;
    }
    
    .row {
        margin: 0;
    }
    
    /* Forms */
    .i-form.horizontal .form-group {
        flex-direction: column;
    }
    
    .i-form.horizontal .form-label {
        flex: 0 0 100%;
        margin-bottom: 0.5rem;
    }
    
    .i-form.horizontal .form-field {
        flex: 1 1 100%;
    }
    
    /* Buttons */
    .i-button.big {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .session-bar-toggle {
        display: block;
    }
    
    .session-bar .toolbar:not(.mobile-open) {
        display: none;
    }
    
    .session-bar .group {
        flex-direction: column;
        width: 100%;
    }
    
    .session-bar .i-button {
        width: 100%;
        margin-bottom: 0.25rem;
        justify-content: flex-start;
    }
    
    /* Layout */
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .banner .title,
    .banner .action-menu {
        width: 100%;
    }
    
    /* Action boxes */
    .action-box .section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-box .toolbar {
        margin-top: 1rem;
        width: 100%;
    }
    
    /* Side menu */
    .side-menu .item .title {
        padding: 0.75rem 1rem;
    }
    
    .side-menu .section .title-wrapper {
        padding: 0.75rem 1rem;
    }
    
    /* Header */
    .header-logo {
        max-height: 50px;
    }
    
    .session-bar .toolbar .group {
        justify-content: flex-start;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
.i-button:focus,
button:focus,
[role="button"]:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #007cac;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .mobile-menu-toggle,
    .mobile-nav-toggle,
    .session-bar-toggle {
        display: none !important;
    }
    
    .menu-items,
    #global-menu-items,
    .session-bar .toolbar {
        display: block !important;
    }
    
    .side-menu {
        break-inside: avoid;
    }
}