/* Custom styles for pwdb section */

body {
    background-color: #f8f9fa; /* Light gray background */
    color: #343a40; /* Dark text color */
}

.wrapper {
    background-color: #ffffff; /* White background for content wrappers */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    margin-bottom: 30px;
}

.app-logo {
    display: block;
    margin: 0 auto 30px auto;
    max-width: 150px;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    color: #cd1719; /* A shade of blue for headings */
    margin-bottom: 20px;
    font-weight: 600;
}

/* Form styling */
form label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    color: #495057;
    margin-top: 15px;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form textarea,
form select {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    color: #495057;
    box-sizing: border-box; /* Include padding in width */
}

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

form input[type="submit"],
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    margin-top: 10px;
}

.btn-primary {
    background-color: #cd1719;
    color: #ffffff;
    border: 1px solid #cd1719;
}

.btn-primary:hover {
    background-color: #a71012;
    border-color: #a71012;
}

.btn-secondary {
    background-color: #fff100;
    color: #cd1719;
    border: 1px solid #fff100;
}

.btn-secondary:hover {
    background-color: #d9c800;
    border-color: #d9c800;
}

.btn-success {
    background-color: #cd1719;
    color: #ffffff;
    border: 1px solid #cd1719;
}

.btn-success:hover {
    background-color: #a71012;
    border-color: #a71012;
}

.btn-danger {
    background-color: #cd1719;
    color: #ffffff;
    border: 1px solid #cd1719;
}

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

.btn-warning {
    background-color: #cd1719;
    color: #ffffff;
    border: 1px solid #cd1719;
}

.btn-warning:hover {
    background-color: #a71012;
    border-color: #a71012;
}

/* Specific styles for pwdb/index.php cards */
.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: #cd1719;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
}

/* Table styling for pw_list.php */
.container-fluid {
    padding: 30px;
}

#searchInput {
    margin-bottom: 20px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

#entrancesTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners apply to table */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

#entrancesTable th,
#entrancesTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

#entrancesTable th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

#entrancesTable tbody tr:hover {
    background-color: #f2f2f2;
}

.copy-target {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.copy-icon {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.copy-target:hover .copy-icon {
    opacity: 1;
}

.hidden-password {
    /* This class is used to hide the password visually, but allow copying */
    /* For security, consider server-side handling or more robust JS */
    /* For now, just a visual cue */
    font-family: 'monospace'; /* To make it look like a password field */
    color: transparent;
    text-shadow: 0 0 8px rgba(0,0,0,0.5); /* Obscure text */
}

.hidden-password:hover {
    color: #343a40; /* Reveal on hover for convenience, but not recommended for high security */
    text-shadow: none;
}

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

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

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

/* Modal styling for password generator */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more responsive */
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

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

.checkbox-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
}

.modal-buttons {
    text-align: right;
    margin-top: 20px;
}

/* User info at top right */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #e9ecef;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #495057;
}

/* History table in edit_password.php */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th,
.history-table td {
    border: 1px solid #dee2e6;
    padding: 8px;
    text-align: left;
}

.history-table th {
    background-color: #f2f2f2;
}

details {
    margin-top: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
}

summary {
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    outline: none;
}

summary:hover {
    color: #cd1719;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wrapper {
        padding: 20px;
        margin-top: 15px;
        margin-bottom: 15px;
    }

    .app-logo {
        max-width: 100px;
    }

    .user-info {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }

    .container-fluid {
        padding: 15px;
    }

    #entrancesTable th,
    #entrancesTable td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}