/* Milligram overrides */
:root {
    /* Updated Forest Green and Golden Yellow colors */
    --color-primary: #2e7d32;
    --color-primary-hover: #1b5e20;
    --color-secondary: #fbc02d;
    --color-secondary-hover: #f9a825;
    
    --color-cakephp-red: var(--color-primary);
    --color-cakephp-gray: #404041;
    --color-cakephp-blue: var(--color-primary);
    --color-cakephp-lightblue: #66bb6a;

    /* These are additional colors */
    --color-lightgray: #606c76;
    --color-white: #fff;

    --color-main-bg: #f4f7f6;
    --color-links: var(--color-primary);
    --color-links-active: var(--color-primary-hover);
    --color-headings: #2c3e50;

    --color-sidebar-bg: #ffffff;
    --color-sidebar-text: #34495e;
    --color-sidebar-active-bg: #e8f5e9;
    --color-sidebar-active-text: var(--color-primary);

    --color-message-success-bg: #e8f5e9;
    --color-message-success-text: #2e7d32;
    --color-message-success-border: #81c784;

    --color-message-warning-bg: #fffde7;
    --color-message-warning-text: #fbc02d;
    --color-message-warning-border: #fff176;

    --color-message-error-bg: #ffeeb;
    --color-message-error-text: #c62828;
    --color-message-error-border: #e57373;

    --color-message-info-bg: #e3f2fd;
    --color-message-info-text: #1565c0;
    --color-message-info-border: #64b5f6;
}

.button, button, input[type='button'], input[type='reset'], input[type='submit'] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.button:hover, button:hover, input[type='button']:hover, input[type='submit']:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.button.outline {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.button.outline:hover {
    color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    background: var(--color-main-bg);
    color: #333;
    margin: 0;
}

.top-nav-links,
.side-nav,
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

/* Layout Wrapper */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - 6.4rem);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--color-sidebar-bg);
    border-right: 1px solid #e0e0e0;
    padding: 2rem 0;
    position: sticky;
    top: 6.4rem;
    height: calc(100vh - 6.4rem);
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    display: none;
    padding: 2rem;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--color-primary);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 1.2rem 2.5rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-item a:hover {
    background: #f8f9fa;
    color: var(--color-primary);
}

.sidebar-item.active a {
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active-text);
    border-left-color: var(--color-primary);
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: var(--color-secondary); /* Golden Yellow */
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 1100;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 3rem;
    height: 0.4rem;
    background: var(--color-primary); /* Forest Green */
    margin: 0.25rem 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(0.9rem) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-0.9rem) rotate(-45deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

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

/* Main Content area */
.main {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Login Page Specific Styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 6.4rem;
    padding: 0 2rem;
    z-index: 101;
    position: sticky;
    top: 0;
}

.top-nav-title a {
    display: flex;
    align-items: center;
    font-size: 2.4rem;
    color: var(--color-primary);
    font-weight: bold;
    text-decoration: none;
    gap: 1rem;
}

.header-logo {
    height: 4rem;
    width: auto;
}

.logout-item {
    margin-top: auto;
    border-top: 1px solid #eee;
}

.logout-item a {
    color: #c62828 !important; /* Material Red */
}

.logout-item a:hover {
    background: #ffebee !important;
}

.top-nav-title span {
    color: var(--color-cakephp-gray);
}

.content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 3rem;
}

/* Table Enhancements */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

th {
    background: #f8f9fa;
    border-bottom: 2px solid #edf2f7;
    color: #4a5568;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    padding: 1.5rem;
    text-align: left;
}

td {
    padding: 1.5rem;
    border-bottom: 1px solid #edf2f7;
}

tr:hover td {
    background-color: #f7fafc;
}

/* View action */
.view.content .text {
    margin-top: 1.2rem;
}

/* Flash messages */
.message {
    padding: 1.5rem;
    background: var(--color-message-info-bg);
    color: var(--color-message-info-text);
    border-left: 4px solid var(--color-message-info-border);
    border-radius: 4px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.message.success {
    background: var(--color-message-success-bg);
    color: var(--color-message-success-text);
    border-left-color: var(--color-message-success-border);
}

.message.error {
    background: var(--color-message-error-bg);
    color: var(--color-message-error-text);
    border-left-color: var(--color-message-error-border);
}

/* Forms */
.input {
    margin-bottom: 2rem;
}

.input label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.input input,
.input select,
.input textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.input input:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* Paginator */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 2rem 0;
}

.pagination li {
    margin: 0 0.5rem;
}

.pagination a {
    padding: 0.8rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-primary);
}

.pagination li.active a {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        width: 6rem;
        height: 6rem;
        z-index: 1001;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-header {
        display: block;
        padding: 2.5rem;
        background: var(--color-primary);
        color: #fff;
    }

    .sidebar-header h3 {
        color: #fff;
        margin: 0;
    }

    .sidebar-menu {
        padding: 0;
    }

    .sidebar-item a {
        border-left: 4px solid transparent;
    }

    .sidebar-item.active a {
        border-left-color: var(--color-primary);
    }

    .main {
        padding: 1.5rem;
    }

    .content {
        padding: 1.5rem;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
    }

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

    .actions a, .actions form {
        margin: 0 !important;
    }

    .float-right {
        float: none !important;
        display: block;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .row {
        flex-direction: column;
    }

    .column {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
}
