/* General Body and Container */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5; /* Lighter background like screenshots */
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 20px auto;
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); /* Softer shadow */
    position: relative;
}

.admin-panel-heading {
    color: #0056b3;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 700;
    border-bottom: 2px solid #e0e0e0; /* Softer underline */
    padding-bottom: 15px;
    letter-spacing: 0.5px;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px; /* Space below the main header section */
    padding-bottom: 15px;
    border-bottom: 1px solid #eee; /* Subtle separator line */
}

h1 {
    color: #2c3e50;
    font-size: 2em;
    font-weight: 600;
    margin: 0; /* Reset default margin to fit flex layout */
}

h2 {
    color: #34495e;
    margin-top: 35px;
    margin-bottom: 20px;
    font-size: 1.6em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: calc(100% - 24px); /* Account for padding */
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Buttons */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-button { /* For the "+ Add SES Configuration" button */
    background-color: #007bff;
    color: white;
    padding: 10px 20px; /* Slightly larger for main action */
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.add-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

.save-button {
    background-color: #007bff;
    color: white;
}

.save-button:hover {
    background-color: #0056b3;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
    margin-right: 10px; /* Space between buttons */
}

.cancel-button:hover {
    background-color: #5a6268;
}

.form-actions {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    padding-top: 20px; /* Space above buttons */
    border-top: 1px solid #eee; /* Separator for buttons */
    margin-top: 30px;
}

/* Table Styling */
.table-responsive {
    overflow-x: auto;
    margin-top: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Lighter shadow for table */
    border-radius: 8px;
    overflow: hidden;
    background-color: white; /* Ensure table background is white */
}

thead th {
    background-color: #f8f9fa;
    color: #495057;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef; /* Softer border */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.7px;
}

tbody tr:nth-child(even) {
    background-color: #fcfcfc; /* Very light zebra striping */
}

tbody tr:hover {
    background-color: #f5f5f5; /* Subtle hover effect */
}

tbody td {
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef; /* Consistent light border */
    color: #555;
    font-size: 0.95em;
}

.no-configs {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
}

/* Flash Messages */
.flash-message {
    margin: 15px 0;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInSlideDown 0.5s forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash-message.success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.flash-message.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

@keyframes fadeInSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal/Overlay Styles */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    width: 90%; /* Responsive width */
    max-width: 600px; /* Max width for larger screens */
    position: relative;
    animation: slideIn 0.3s ease-out; /* Animation for modal entry */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0; /* Reset margin for h2 within modal header */
    border-bottom: none; /* Remove border from h2 in modal header */
    padding-bottom: 0;
    font-size: 1.8em; /* Adjust font size for modal heading */
}

.close-button {
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.modal-form {
    padding-top: 10px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 15px auto;
    }
    .header-section {
        flex-direction: column; /* Stack elements vertically */
        align-items: flex-start;
    }
    .header-section h1 {
        margin-bottom: 15px; /* Space between title and button */
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.4em;
    }
    button {
        width: auto; /* Adjust for stacked buttons */
        padding: 12px 20px;
    }
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .form-actions {
        flex-direction: column;
        align-items: flex-end;
    }
    .form-actions button {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    .form-actions button:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
        border-radius: 8px;
    }
    .admin-panel-heading {
        font-size: 2em;
    }
    h1 {
        font-size: 1.5em;
    }
    h2 {
        font-size: 1.2em;
    }
    thead th, tbody td {
        padding: 10px 12px;
        font-size: 0.8em;
    }
    .add-button {
        font-size: 1em;
        padding: 8px 15px;
    }
    .modal-content {
        padding: 15px;
    }
    .modal-header h2 {
        font-size: 1.5em;
    }
    .close-button {
        font-size: 24px;
    }
}