/* css/admin.css */

/* General Body and UI Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Roboto', sans-serif;
    color: #1c1e21;
}

.ui-container {
    width: 100%;
    margin: 20px 0;
    padding: 2rem 0;
    background-color: #ffffff;
    box-sizing: border-box;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

/* --- TAB STYLES (UUSI) --- */
.admin-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #005A9C;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #005A9C;
    border-bottom-color: #005A9C;
    font-weight: 600;
}

.tab-pane {
    display: none; /* Piilota oletuksena */
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block; /* Näytä aktiivinen */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LOPPU TAB STYLES --- */

/* Login Page Specific Styles */
.login-container {
    max-width: 400px;
    text-align: center;
    margin: 5% auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}

.login-container h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.login-container .btn-primary {
    margin-top: 2rem;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form label {
    font-weight: 600;
    text-align: left;
    font-size: 0.9rem;
    color: #555;
}

form input[type="text"],
form input[type="password"],
form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
}

.modal-content form {
    padding: 0;
}

.ui-container section#add-user form {
    padding: 0 2rem;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form select:focus {
    outline: none;
    border-color: #4a69bd;
    box-shadow: 0 0 0 2px rgba(74, 105, 189, 0.2);
}

/* Button Styles (General) */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #00adbc;
    color: white;
}

.btn-primary:hover {
    background-color: #00a2b1;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    font-size: 0.8rem;
    padding: 6px 12px;
}
.btn-danger:hover {
    background-color: #c0392b;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
    font-size: 0.8rem;
    padding: 6px 12px;
    margin-left: 5px;
}
.btn-secondary:hover {
    background-color: #5a6268;
}
.btn-info {
    background-color: #17a2b8;
    color: white;
    font-size: 0.8rem;
    padding: 6px 12px;
    margin-right: 5px;
}
.btn-info:hover {
    background-color: #138496;
}

.btn:active {
    transform: scale(0.98);
}

/* Admin Panel Table Styles */
.user-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 2rem;
}
.user-list-header h3 {
    margin: 0;
}
.user-list-header .btn-primary {
    font-size: 0.9rem;
    padding: 10px 16px;
}
.user-list-header .material-symbols-outlined {
    font-size: 20px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

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

.user-table th:first-child,
.user-table td:first-child {
    padding-left: 2rem;
}
.user-table th:last-child,
.user-table td:last-child {
    padding-right: 2rem;
}

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

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

.user-table tbody tr:hover {
    background-color: #f1f1f1;
}

.user-table td span.username {
    display: block;
    font-weight: 600;
}
.user-table td small.user-email {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 2px;
}
.text-muted {
    color: #6c757d;
    font-size: 0.85em;
}

.user-table th.text-center, .user-table td.text-center {
    text-align: center;
    vertical-align: middle;
}

/* Action Cell Buttons */
.action-cell {
    display: flex;
    align-items: flex-start; 
    justify-content: flex-end; 
    gap: 12px;
    padding-top: 16px;
}
.btn-icon-action {
    display: flex;
    flex-direction: column; 
    align-items: center;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    width: 70px;
}
.btn-icon-action:hover {
    background-color: #f1f1f1;
}
.btn-icon-action .material-symbols-outlined {
    font-size: 28px;
    line-height: 1;
}
.btn-icon-action span {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 2px;
}
.btn-icon-action.edit .material-symbols-outlined {
    color: #17a2b8;
}
.btn-icon-action.password .material-symbols-outlined {
    color: #6c757d;
}
.btn-icon-action.delete .material-symbols-outlined {
    color: #e74c3c;
}
.action-cell form {
    display: inline-block;
    margin: 0;
    padding: 0;
}
.action-cell-spacer {
    display: block;
    height: 54px;
    width: 70px;
}

/* Header/Welcome Message */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
}
.admin-header p { margin: 0; }
.admin-header a { color: #4a69bd; text-decoration: none; font-weight: bold; }
.admin-header a:hover { text-decoration: underline; }

/* Session/Error Messages */
.error-message {
    background-color: #ffebe9;
    color: #c0392b;
    padding: 12px;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    margin-left: 2rem;
    margin-right: 2rem;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    margin-left: 2rem;
    margin-right: 2rem;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
}
.modal-content {
    background-color: #fff;
    margin: 15% auto; 
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
.modal-content h2 {
    margin-top: 0;
}
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Modal Checkbox Styles */
.form-group-checkbox {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.form-group-checkbox input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    margin-right: 10px;
    flex-shrink: 0;
}
.form-group-checkbox label {
    margin-bottom: 0;
    font-weight: normal;
}
.form-group-checkbox[style*="opacity: 0.5"] {
    background-color: #f8f9fa;
    border: 1px dashed #e2e8f0;
    color: #6c757d;
    cursor: not-allowed;
}