/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a; /* Very dark gray background */
    color: #f0f0f0; /* Off-white text for readability */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Banner Styling */
.top-banner {
    width: 100%;
    background-color: #2c2c2c; /* Dark gray banner */
    padding: 10px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.app-icon {
    height: 40px;
    margin-right: 15px;
}

#banner-title {
    color: #a7c7e7; /* Pastel blue accent for the title */
    margin: 0;
    font-size: 1.5em;
    font-weight: 500;
}

/* Main Content Containers */
.main-content-container {
    background-color: #2c2c2c; /* Matching dark gray for containers */
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
}

/* Styling for Form Inputs and Button */
.main-content-container {
    /* Removed flex-direction and gap from the container */
    width: 90%;
    max-width: 800px; /* Wider container to accommodate two columns */
    margin: 20px auto;
}

#data-input-container .form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 15px;
    margin-top: 15px;
}


input[type="text"],
input[type="url"],
input[type="password"],
textarea, input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #555; /* Subtle gray border */
    border-radius: 5px;
    background-color: #3a3a3a; /* Slightly lighter gray for input fields */
    color: #f0f0f0;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #a7c7e7; /* Pastel blue border on focus */
    box-shadow: 0 0 0 3px rgba(167, 199, 231, 0.2);
}

input::placeholder {
    color: #888;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    align-self: flex-end; /* Align button to the right */
    margin-top: 10px;
}

button[type="submit"] {
    background-color: #a7c7e7; /* Pastel blue accent */
    color: #1a1a1a; /* Dark text for contrast */
}

button.cancel-button:hover {
    transform: translateY(-2px);
}

button.cancel-button {    
    color: #a7c7e7; /* Inverted: light text */
    background-color: #1a1a1a;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr; /* Two columns on larger screens */
    }
}

button[type="submit"]:hover {
    background-color: #93b4d6; /* Slightly darker blue on hover */
    transform: translateY(-2px);
}

/* Placeholder for existing data */
#existing-data-container, #bulk-upload-container {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between title and list */
}

/* --- Styles for the dynamically loaded site list --- */
#existing-data-container h2,
#existing-data-container h2 {
    margin: 0 0 10px 0;
    color: #a7c7e7; /* Pastel blue accent for the heading */
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    font-weight: 500;
}

.site-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.site-item {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #a7c7e7; /* Accent border */
    display: grid;
    grid-template-columns: 1fr auto auto; /* Info | Password | Actions */
    align-items: center;
    gap: 20px;
}

.site-item strong {
    font-size: 1.1em;
    color: #f0f0f0;
}

.site-item,#results-container a {
    color: #a7c7e7;
    text-decoration: none;
    word-break: break-all; /* Prevent long URLs from overflowing */
}

.site-item a:hover {
    text-decoration: underline;
}

.site-item span, .error-message {
    font-size: 0.9em;
    color: #ccc;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden; /* Prevents long text from breaking layout */
}

.form-status {
    margin-top: 10px;
    font-size: 0.9em;
    min-height: 1.2em; /* Reserve space to prevent layout shift */
    text-align: right;
    color: #ff8a80; /* A light red for errors */
}

/* --- Password Toggle Styles --- */
.password-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #4a4a4a;
    padding: 8px 12px;
    border-radius: 4px;
    min-width: 180px; /* Give it a consistent width */
}

.password-text {
    font-family: "Courier New", Courier, monospace;
    color: #f0f0f0;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toggle-password-btn {
    background-color: #666;
    color: #f0f0f0;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-password-btn:hover {
    background-color: #777;
}

/* --- Action Buttons (Delete) --- */
.actions-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Edit Button Styles */
.edit-btn {
    background-color: #3a7a5a; /* Greenish color for edit */
    color: #e0f7fa; /* Light text */
    border: 1px solid #4caf50; /* Slightly darker green border */
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    margin-right: 5px; /* Add some space between edit and delete buttons */
    line-height: 1.2;
}

.edit-btn:hover {
    background-color: #4caf50; /* Brighter green on hover */
    border-color: #66bb6a;
    color: #fff;
}


.delete-btn {
    background-color: #5c2b29; /* Dark, muted red */
    color: #ffcdd2; /* Light red text */
    border: 1px solid #c62828;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;

    transition: background-color 0.2s, border-color 0.2s;
    line-height: 1.2;
}

.delete-btn:hover {
    background-color: #c62828; /* Brighter red on hover */
    border-color: #e53935;
    color: #fff;

}


/* --- Bulk Upload Styles --- */
#bulk-upload-container h2 {
    margin-top: 0;
    color: #a7c7e7;
    font-weight: 500;
}

.csv-instructions {
    padding-left: 20px;
    color: #ccc;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.csv-instructions li {
    margin-bottom: 5px;
}

#bulk-site-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Style the file input */
input[type="file"] {
    color: #ccc;
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 8px;
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    border: none;
    background: #a7c7e7;
    padding: 8px 12px;
    border-radius: 4px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color .2s;
}

input[type="file"]::file-selector-button:hover {
    background: #93b4d6;
}

.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    z-index: 1000; /* Ensure it's on top */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #3a3a3a;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    margin: auto; /* Center the modal content */
}
@media (min-width: 768px) {
    main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
        width: 80%;
    }
}

button#submit-bulk {
    /* Reuse existing button styles */
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    background-color: #a7c7e7;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    align-self: flex-end;
    margin-top: 10px;
}

.result-table tr {
    list-style: none; /* Remove bullets */
    padding: 0;
}

.result-table tr:nth-child(odd) {
    background-color: #444; /* Slightly lighter background for odd items */
    padding: 5px;
    border-radius: 4px;
}

.result-table tr:nth-child(even) {
    background-color: #333; /* Slightly darker background for even items */
    padding: 5px;
    border-radius: 4px;
}

button#submit-bulk:hover {
    background-color: #93b4d6;
    transform: translateY(-2px);
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ccc;
}

.tab {
    padding: 10px 15px;
    border: none;
    border-radius: 0;;
    background-color: #f0f0f0;
    cursor: pointer;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.tab.active {
    background-color: #ddd;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}