/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header Styles */
.main-header {
    background-color: #2c3e50;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.logo a {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
    position: relative;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

nav ul li a:hover {
    text-decoration: underline;
}

.dropdown {
    display: none;
    position: absolute;
    background-color: #34495e;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;
    border-radius: 4px;
}

.dropdown li {
    margin: 0;
}

.dropdown li a {
    padding: 12px 16px;
    display: block;
    color: white;
}

.dropdown li a:hover {
    background-color: #2c3e50;
    text-decoration: none;
}

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

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button, .btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: #2980b9;
    text-decoration: none;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f9f9f9;
}

/* Dashboard Styles */
.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.stat-card p {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #3498db;
}

.quick-actions {
    margin-bottom: 30px;
}

.recent-items {
    margin-top: 30px;
}

/* Message Styles */
.error, .success, .notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 5px solid #c62828;
}

.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 5px solid #2e7d32;
}

.notice {
    background-color: #fff8e1;
    color: #ff8f00;
    border-left: 5px solid #ff8f00;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 30px;
    color: #2c3e50;
}

.info-box {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Add these styles to your existing style.css file */

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-actions h1 {
    margin: 0;
}

.actions {
    white-space: nowrap;
}

.actions .btn-small {
    margin-right: 5px;
}

.actions .btn-small:last-child {
    margin-right: 0;
}

.data-table td.actions {
    text-align: right;
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* Profile form styles */
.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.profile-form h2 {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.profile-form small {
    color: #666;
    display: block;
    margin-top: 5px;
}

.profile-form input[disabled] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Layout */
main {
    flex: 1 0 auto;
    padding: 20px;
    transition: padding-left .3s;
}

/* Sidenav */
.sidenav {
    transform: translateX(-105%);
    transition: transform .3s;
}

/* Desktop styles */
@media only screen and (min-width: 993px) {
    .sidenav {
        transform: translateX(0) !important;
    }
    
    .sidenav-overlay {
        display: none !important;
    }
    
    main {
        padding-left: 300px;
    }
    
    .sidenav-trigger {
        display: none;
    }
}

/* Mobile styles */
@media only screen and (max-width: 992px) {
    .sidenav {
        width: 85%;
        max-width: 300px;
    }
    
    .sidenav.sidenav-fixed {
        transform: translateX(-105%);
    }
    
    .sidenav.sidenav-fixed.show {
        transform: translateX(0);
    }
    
    main {
        padding-left: 0;
        padding-top: 64px;
    }
    
    .sidenav-trigger {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 997;
        background: white;
        border-radius: 50%;
        padding: 0;
        width: 48px;
        height: 48px;
        line-height: 48px;
        text-align: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .sidenav-trigger i {
        line-height: 48px;
    }
}

/* Fix iOS issues */
@supports (-webkit-touch-callout: none) {
    .sidenav {
        height: -webkit-fill-available;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Overlay styles */
.sidenav-overlay {
    background-color: rgba(0,0,0,0.4);
    will-change: opacity;
    transition: opacity .3s;
    z-index: 996;
}

/* Cards */
.stat-card {
    padding: 20px;
}

.stat-card .card-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.stat-card .big-number {
    font-size: 2.5rem;
    font-weight: 300;
    margin: 15px 0;
}

/* Warning Banners */
.warning-banner {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.warning-banner i {
    vertical-align: middle;
    margin-right: 8px;
}

.expiration-warning {
    background-color: #fff3e0;
    color: #e65100;
}

.payment-warning {
    background-color: #ffebee;
    color: #c62828;
}

/* Stats */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.metric {
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 300;
    color: #2196f3;
}

.metric-label {
    color: #757575;
    font-size: 0.9rem;
}

/* Action Buttons */
.fixed-action-btn {
    bottom: 45px;
    right: 24px;
}

/* Card styles */
.card {
    margin: 0;
}

.card .card-title {
    font-size: 1.2rem !important;
    display: flex !important;
    align-items: center;
}

.card .card-title i {
    margin-right: 8px;
}

/* Table styles */
table.striped > tbody > tr:nth-child(odd) {
    background-color: rgba(242, 242, 242, 0.5);
}

.chip {
    height: 24px;
    line-height: 24px;
    padding: 0 12px;
}

/* Stats cards */
.card h4 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 300;
}

/* Action buttons spacing */
.btn-floating.btn-small {
    margin: 0 4px;
}

/* Empty state */
.material-icons.large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.action-buttons .btn-small {
    margin: 0 4px;
    padding: 0 12px;
    height: 32px;
    line-height: 32px;
}

.action-buttons .btn-small i {
    margin-right: 4px;
    font-size: 16px;
    line-height: 32px;
}

/* Table styling */
table.striped {
    border-radius: 4px;
}

table.striped thead th {
    font-weight: 500;
    color: #424242;
}

table.striped tbody td {
    padding: 12px 5px;
    vertical-align: middle;
}

.chip {
    font-weight: 500;
    background-color: #e3f2fd;
    color: #1976d2;
}

/* DataTables customization */
.dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_length select {
    display: inline-block;
    width: auto;
    height: 32px;
    padding: 0 30px 0 10px;
}

.dataTables_filter input {
    height: 32px;
    margin-left: 10px;
    padding: 0 10px;
}

.dataTables_info {
    color: #666;
}

.dataTables_paginate {
    margin-top: 10px;
}

.dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.dataTables_paginate .paginate_button.current {
    background: #2196f3;
    color: white !important;
    border-color: #2196f3;
}

.dataTables_paginate .paginate_button:hover {
    background: #e3f2fd;
    color: #1976d2 !important;
}

/* Responsive table adjustments */
.responsive-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Stats page specific styles */
.stat-card {
    padding: 20px;
    border-radius: 4px;
    background: #f5f5f5;
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.stat-card .material-icons {
    font-size: 2.5rem;
    margin-right: 20px;
}

.stat-card .stat-title {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-card .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 500;
}

/* Table adjustments */
#stats-table td {
    vertical-align: middle;
}

#stats-table .btn-small {
    margin: 5px;
}

/* Add/update these styles */
.sidenav {
    height: 100vh;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
}

.sidenav.show {
    transform: translateX(0);
}

.sidenav .user-view {
    padding: 32px 32px 16px;
    margin-bottom: 0;
}

.sidenav li > a {
    height: 50px;
    line-height: 50px;
    font-weight: normal;
}

.sidenav .divider {
    margin: 8px 0;
}

/* Mobile trigger button */
.sidenav-trigger {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color .3s;
}

.sidenav-trigger i {
    color: #333;
}

/* Card responsiveness */
.row .col {
    padding: 0 10px;
}

@media only screen and (max-width: 600px) {
    .row .col {
        padding: 0 5px;
    }
    
    .card-content {
        padding: 20px 15px;
    }
}

/* Action buttons responsiveness */
@media only screen and (max-width: 600px) {
    .action-buttons .btn-small {
        width: 100%;
        margin: 2px 0;
    }
}

/* Fix iOS Safari issues */
@supports (-webkit-touch-callout: none) {
    .sidenav, 
    .sidenav-overlay {
        height: -webkit-fill-available;
    }
}

/* DataTables responsive fixes */
@media screen and (max-width: 640px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
    }
    
    .dataTables_wrapper .dataTables_filter {
        margin-top: 10px;
    }
}

/* Stats cards responsive layout */
@media only screen and (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* DataTables Responsive Styles */
.dataTables_wrapper {
    width: 100%;
    margin: 0 auto;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    padding-left: 30px !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    top: 50%;
    transform: translateY(-50%);
    background-color: #2196f3;
    border: none;
    box-shadow: none;
    height: 16px;
    width: 16px;
    line-height: 16px;
    border-radius: 3px;
}

.dtr-details {
    width: 100%;
    margin-bottom: 10px;
}

.dtr-details li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.dtr-details li:last-child {
    border-bottom: none;
}

.dtr-title {
    font-weight: 500;
    color: #424242;
    margin-right: 10px;
}

.dtr-data {
    text-align: right;
}

/* Mobile optimizations */
@media screen and (max-width: 640px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: left;
        margin: 10px 0;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: calc(100% - 100px);
        margin: 0;
        margin-left: 10px;
    }

    /* Adjust button spacing in responsive view */
    .dtr-data .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .dtr-data .btn-small {
        width: 100%;
        margin: 0;
    }
}

/* Better touch targets on mobile */
@media (max-width: 767px) {
    table.dataTable > tbody > tr > td {
        padding: 15px 10px;
    }

    .paginate_button {
        min-width: 40px;
        min-height: 40px;
        line-height: 40px;
        margin: 2px !important;
    }
}

/* DataTable container styles */
.table-container {
    width: 100%;
    margin: 0;
    overflow: visible;
}

/* DataTable wrapper styles */
.dataTables_wrapper {
    padding: 0;
    margin: 0;
}

/* Table styles */
table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse;
}

/* Card content padding */
.card .card-content {
    padding: 24px;
}

/* Controls spacing */
.dataTables_length,
.dataTables_filter {
    padding: 8px 0;
}

/* Pagination controls */
.dataTables_paginate {
    padding: 8px 0;
    margin-top: 8px !important;
}

/* Info text */
.dataTables_info {
    padding: 8px 0;
}

/* Row styles */
table.dataTable tbody tr {
    background-color: transparent;
}

table.dataTable tbody td {
    padding: 12px 8px;
    vertical-align: middle;
}

/* Responsive adjustments */
@media screen and (max-width: 992px) {
    .dataTables_wrapper .row .col {
        padding: 0;
    }
    
    .dataTables_filter {
        margin-top: 8px;
    }
    
    .dataTables_length select {
        width: 80px;
    }
}

/* Remove extra margins from Materialize rows inside DataTables */
.dataTables_wrapper .row {
    margin-bottom: 0;
}

/* Adjust the card content spacing */
.card .card-content .table-container {
    margin: -12px -24px;
    width: calc(100% + 48px);
}

/* Add these styles */
.chip.blue {
    background-color: #2196F3;
}

.chip.green {
    background-color: #4CAF50;
}

.chip.grey {
    background-color: #9E9E9E;
}

.helper-text {
    color: #757575;
    font-size: 0.8rem;
    margin-left: 35px;
} 