/* Bootstrap and FontAwesome Integration */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css');
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap');

/* Variables */
:root {
    --primary-color: #007BFF;
    --secondary-color: #f4f4f9;
    --text-color: #222;
    --background-color: transparent;
    --link-color: var(--primary-color);
    --border-color: #ddd;
    --button-bg: var(--primary-color);
    --button-text: #ffffff;
    --input-bg: #f9f9f9;
    --input-border: var(--border-color);
    --input-text: var(--text-color);
    --footer-bg: #121416;
    --footer-text: #fff;
    --background-image: url('/images/light.png');
}

[data-theme="dark"] {
    --primary-color: #00A3FF; /* Slightly brighter blue */
    --secondary-color: #181A1B; /* Darker grey for better contrast */
    --background-color: transparent;
    --text-color: #E0E0E0; /* Light grey for better readability */
    --link-color: #1E90FF; /* Keep bright links */
    --border-color: #333; /* Softer border for dark mode */
    --button-bg: #005BBB; /* Deep blue to match dark theme */
    --button-text: #FFFFFF;
    --input-bg: #25282A; /* Slightly lighter dark */
    --input-border: #444;
    --input-text: #E0E0E0;
    --footer-bg: #0F1011;
    --footer-text: #CCCCCC;
    --background-image: url('/images/dark.png');
}

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans', sans-serif;
}

/* Body Styling */
body {
    background: var(--background-image) no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    transition: background 0.3s, color 0.3s;
}

/* Links */
a {
    text-decoration: none;
    color: var(--link-color);
}

a:hover {
    text-decoration: underline;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    color: var(--button-text);
    padding: 10px;
    z-index: 100;
    text-decoration: none;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 10px;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--button-text);
    padding: 10px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 250px;
    width: 250px;
}

.logo img {
    height: 200px;
    width: 200px;
}

/* Settings Button Styling */
.settings-container {
    margin-bottom: 15px;
}

.settings-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.settings-button:hover {
    background: darken(var(--button-bg), 10%);
}
/* Base styles for the settings dialog */

.settings-dlg {
    width: 90%;
    max-width: 500px; /* Prevents excessive width */
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: fixed;
    inset: 0; /* Centers the dialog horizontally & vertically */
    margin: auto; /* Ensures perfect centering */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    direction: inherit; /* Supports RTL */
}

/* Ensure dialog is hidden initially */
.settings-dlg:not([open]) {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Dialog Header */
.dialog-header {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

/* Form Sections */
.settings-dlg div {
    margin-bottom: 15px;
}

/* Fieldset (Theme Selection) */
.settings-dlg fieldset {
    border: none;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Labels for Theme Radio Buttons */
.settings-dlg label, .settings-dlg h3 {
    display: block;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color);
    text-align: center;
}

/* Theme Radio Buttons */
.settings-dlg input[type="radio"] {
    accent-color: var(--primary-color);
    color: var(--text-color);
}

/* Select Dropdown */
.settings-dlg select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--input-text);
    border-radius: 5px;
}

/* Action Buttons */
.dialog-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Save Button */
.settings-save-button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.settings-save-button:hover {
    background: darken(var(--button-bg), 10%);
}

/* Cancel Button */
.settings-cancel-button {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.settings-cancel-button:hover {
    background: var(--border-color);
}

/* Dark Mode Adjustments */
[data-theme="dark"] .settings-dlg {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .settings-cancel-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .settings-dlg {
        width: 95%;
        padding: 15px;
    }

    .dialog-actions {
        flex-direction: column;
        gap: 10px;
    }

    .settings-save-button, .settings-cancel-button {
        width: 100%;
    }
}



/* Horizontal Line */
header hr {
    width: 80%;
    border: 1px solid var(--border-color);
    margin: 15px 0;
}


/* Navigation Menu */
.menu {
    list-style: none;
    display: flex;
    gap: 15px;
}

.menu li {
    display: inline;
}

.menu a {
    color: var(--button-text);
    font-weight: bold;
}

.menu a:hover {
    text-decoration: underline;
}

/* Toggle Button for Mobile */
.toggle-button {
    display: none;
    background: none;
    border: 2px solid var(--button-text);
    color: var(--button-text);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 20px;
}

/* Responsive Menu for Mobile */
@media (max-width: 768px) {
    .toggle-button {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        background: var(--primary-color);
        position: absolute;
        top: 60px;
        right: 20px;
        width: 200px;
        padding: 10px;
        border-radius: 5px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .menu.active {
        display: flex;
    }

    .menu li {
        margin: 10px 0;
    }
}

.sub-list {
    list-style: none;
    padding-left: 20px; /* Indent to align with parent */
    display: none; /* Hidden by default */
    position: absolute; /* Place under parent */
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.sub-list li {
    margin: 5px 0;
}

.sub-list a {
    color: var(--link-color);
    padding: 5px 10px;
    display: block;
    text-decoration: none;
}

.sub-list a:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .sub-list {
        position: static; /* Stack within parent on small screens */
        padding-left: 0;
        box-shadow: none;
        border: none;
    }

    .sub-list li {
        margin: 10px 0;
    }

}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    display: block;
    font-size: 1rem;
    margin-bottom: 5px;
}


input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
    border-radius: 5px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* Footer */
footer {
    background: none;
    color: var(--footer-text);
    padding: 20px;
    text-align: center;
}

/* Footer Links (Unified List) */
footer .footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Ensures wrapping on smaller screens */
    justify-content: center; /* Centers items horizontally */
    gap: 10px 20px; /* Space between links */
}

footer .footer-links ul li {
    font-size: 0.9rem;
}

footer .footer-links ul li a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer .footer-links ul li a:hover {
    text-decoration: underline;
    color: var(--link-hover-color, var(--link-color)); /* Optional hover color */
}

/* Legal Links */
footer .legal-links {
    margin-top: 20px;
    font-size: 0.9rem;
}

footer .legal-links a {
    color: var(--link-color);
    text-decoration: none;
    margin: 0 5px;
}

footer .legal-links a:hover {
    text-decoration: underline;
}

/* Copyright Section */
footer .copyright {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--footer-text);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    footer .footer-links ul {
        flex-direction: column; /* Stack links vertically on smaller devices */
        align-items: center;
        gap: 5px;
    }
    
    footer .footer-links ul li {
        margin: 5px 0; /* Add spacing between vertical items */
    }

    footer {
        padding: 15px;
    }

    footer .legal-links {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    footer {
        font-size: 0.8rem;
        padding: 10px;
    }

    footer .footer-links ul li {
        font-size: 0.85rem;
    }

    footer .legal-links {
        font-size: 0.8rem;
    }
}


/* Dialog */
dialog {
    border: none;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    background: var(--background-color);
    color: var(--text-color);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.dialog-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    header {
        flex-direction: column;
        text-align: center;
    }

    .menu {
        gap: 10px;
    }

    footer {
        padding: 15px;
        font-size: 0.9rem;
    }
}



/* Error Page Container */
.error-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Error Headings */
.error-container h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: bold;
}

/* Error Content */
.error-content {
    margin: 30px 0;
    color: var(--text-color);
}

.error-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.error-content ul {
    list-style-position: inside;
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
}

.error-content ul li {
    margin-bottom: 10px;
    color: var(--text-color);
}

/* Error Actions */
.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Error Buttons */
.error-actions .btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    transition: opacity 0.3s;
    border: none;
    cursor: pointer;
}

.error-actions .btn:hover {
    opacity: 0.9;
}

.error-actions .btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.error-actions .btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 600px) {
    .error-container {
        margin: 20px;
        padding: 15px;
    }

    .error-container h1 {
        font-size: 2em;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }
}


/* Login Page Styles */
.login-container {
    background-color: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 20px auto;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--text-color);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.input-group input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

/* Password Wrapper */
/* Password Wrapper */
.password-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Input Styling */
.password-wrapper input {
    width: 100%;
    padding-inline-end: 50px; /* Reserve space dynamically for the button */
    height: 40px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 8px 12px;
    box-sizing: border-box;
}

/* Toggle Button Styling */
.toggle-password {
    position: absolute;
    inset-inline-end: 10px; /* Align dynamically based on LTR or RTL */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:focus {
    outline: 2px solid var(--primary-color);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .password-wrapper input {
        padding-inline-end: 45px;
    }

    .toggle-password {
        inset-inline-end: 5px;
    }
}

.btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.login-btn {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.login-btn:hover {
    background-color: var(--primary-color, #0056b3);
    transform: scale(1.02);
}

#google-link {
    display: block;
    text-align: center;
    margin: 10px 0;
}

#google-link img {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.forgot-password {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--link-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}



/* Profile Container */
.profile-container {
    max-width: 800px;
    margin: 50px auto;
    background: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* Section Title */
.profile-section-title {
    background: var(--primary-color);
    color: var(--button-text);
    font-size: 18px;
    font-weight: bold;
    padding: 12px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

/* Profile Table */
.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table th,
.profile-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.profile-table th {
    background-color: var(--secondary-color);
    font-weight: bold;
    color: var(--text-color);
    width: 30%;
}

.profile-table td {
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Alternating Row Colors */
.profile-table tr:nth-child(even) td {
    background-color: var(--secondary-color);
}

/* Hover Effect */
.profile-table tr:hover td {
    background-color: var(--input-bg);
}

/* Footer Section */
.profile-footer {
    text-align: center;
    padding: 15px;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--border-color);
}

.profile-footer a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: bold;
}

.profile-footer a:hover {
    text-decoration: underline;
}



input[type="text"], 
input[type="password"], 
input[type="submit"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--input-text);
}

/* Button Styles */
input[type="submit"] {
    background-color: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    font-weight: bold;
    border: none;
}

input[type="submit"]:hover {
    opacity: 0.9;
}

/* Error and Message Styles */
.error, .message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
}

.error {
    background: #ffdddd;
    color: #d8000c;
    border: 1px solid #d8000c;
}

.message {
    background: #ddffdd;
    color: #4f8a10;
    border: 1px solid #4f8a10;
}

/* Password Visibility Toggle */
.show-password {
    display: flex;
    align-items: center;
    gap: 5px;
}

.show-password label {
    font-weight: normal;
}

/* Google Button */
#google-link img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: auto;
}

/* Responsive */
@media (max-width: 480px) {
    form {
        padding: 15px;
    }
}


/* Responsive Navigation */
.software-nav {
    background-color: var(--secondary-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Noto Sans', sans-serif;
}

.software-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.software-nav ul li {
    margin: 0;
}

.software-nav ul li a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s;
    display: block;
    text-align: center;
}

.software-nav ul li a:hover,
.software-nav ul li a:focus {
    background-color: var(--primary-color);
    color: var(--button-text);
}

/* Main Title */
.soft-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 1.5rem 1rem 1rem;
    color: var(--text-color);
    text-align: center;
}

/* Page Content */
.software-page-content {
    font-family: 'Noto Sans', sans-serif;
    padding: 1rem;
    color: var(--text-color);
}

/* Responsive Lists */
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

/* Definition Lists */
dl {
    margin: 1rem 0;
}

dt {
    font-weight: bold;
    color: var(--primary-color);
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Details and Summary */
details {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

summary {
    font-weight: 600;
    color: var(--link-color);
    cursor: pointer;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:hover, a:focus {
    color: var(--primary-color);
}

/* Buttons */
button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-family: 'Noto Sans', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
}

button:hover, button:focus {
    background-color: #0056b3;
}

/* Responsive Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    display: block;
}

th, td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
    min-width: 120px;
}

th {
    background-color: var(--secondary-color);
    font-weight: 600;
    color: var(--text-color);
}

tbody tr:nth-child(even) {
    background-color: var(--input-bg);
}

/* === Media Queries for Mobile Devices === */
@media (max-width: 768px) {
    .software-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    .software-nav ul li a {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .soft-title {
        font-size: 1.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .software-page-content {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .soft-title {
        font-size: 1.25rem;
    }

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

    details summary {
        font-size: 1rem;
    }
}
