/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Navigation */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 30px;
}

.header-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    color: white;
    font-weight: 500;
    font-size: 0.95em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-logout {
    padding: 8px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

/* Main Layout Wrapper */
.layout-wrapper {
    display: flex;
    flex: 1;
}

/* Sidebar Navigation */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0ff 50%, #667eea 100%);
    color: white;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 15px 25px;
    color: #333333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar ul li a:hover {
    background-color: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    padding-left: 30px;
    color: #667eea;
}

.sidebar ul li a.active {
    background-color: rgba(102, 126, 234, 0.2);
    border-left-color: #667eea;
    color: #667eea;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px 20px 80px 20px; /* Added bottom padding for footer */
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header Styles */
h1, h2, h3 {
    color: #333;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

a, button {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1em;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #f093fb;
    color: white;
}

.btn-secondary:hover {
    background-color: #e080e8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn-success {
    background-color: #13ce66;
    color: white;
}

.btn-success:hover {
    background-color: #0fa850;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(19, 206, 102, 0.4);
}

.btn-danger {
    background-color: #ff4757;
    color: white;
}

.btn-danger:hover {
    background-color: #ff3838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.btn-info {
    background-color: #0984e3;
    color: white;
}

.btn-info:hover {
    background-color: #0770d0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(9, 132, 227, 0.4);
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Container */
.form-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 30px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background-color: #667eea;
    color: white;
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background-color: #f5f5f5;
}

table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Action Links in Table */
.action-links {
    display: flex;
    gap: 10px;
}

.action-links a {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0ff 50%, #667eea 100%);
    color: #f5f5f5;
    padding: 12px;
    text-align: center;
    font-size: 0.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-top: auto;
    width: 250px;
    position: fixed;
    bottom: 0;
    left: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e9ecef;
    border-radius: 10px;
}

/* Navigation Bar - Old Style */
.navbar {
    display: none;
}

/* Alert Messages */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.search-bar button {
    padding: 12px 30px;
}

/* Pagination Styles */
.pagination-container {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    background: white;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: bold;
}

.pagination-btn.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9em;
    color: #6c757d;
    text-align: center;
}

.pagination-info span {
    margin: 0 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .main-content {
        padding: 10px;
    }

    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
    }

    .sidebar ul li a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .sidebar ul li a:hover {
        border-left: none;
        border-bottom-color: #667eea;
        padding-left: 15px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .header-content {
        padding: 0 15px;
        flex-direction: column;
        height: auto;
        gap: 10px;
    }

    .header-user {
        width: 100%;
        justify-content: space-between;
    }

    .username {
        font-size: 0.85em;
    }

    .button-group {
        flex-direction: column;
    }

    a, button {
        width: 100%;
        text-align: center;
    }

    table {
        font-size: 0.9em;
    }

    table th, table td {
        padding: 10px;
    }

    .action-links {
        flex-direction: column;
    }

    .action-links a {
        width: 100%;
        text-align: center;
    }

    .footer {
        position: static;
        width: 100%;
        margin-top: 20px;
    }
}
