/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Loading overlay styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #6a0dad; /* Updated to purple */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #6a0dad; /* Updated to purple */
    font-size: 1.2rem;
    font-weight: 500;
}

/* Header styles */
header {
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-top {
    background-color: #d8bfd8; /* Updated light purple color */
    padding: 0.1rem 0;
}

.header-bottom {
    background-color: #6a0dad; /* Updated to purple */
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); /* Shadow effect below */
    display: flex;
    align-items: center;
    height: 30px; /* Adjusted height for better proportions */
}

.header-bottom .container {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Main Navigation Styles */
.main-nav {
    width: 100%;
}

.main-nav ul {
    display: flex;
    list-style: none;
    justify-content: left;
    padding: 0;
    margin: 0;
    height: 100%;
}

.main-nav ul li {
    margin: 0;
    display: flex;
    align-items: center;
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 30px;
    font-weight: 500;
    font-size: 14px; /* Reduced font size from default */
    transition: background-color 0.3s ease;
}

.main-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.main-nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: bold;
}

.logo {
    display: flex;
    align-items: center;
    height: 50px; /* Fixed height for the header top section */
    overflow: hidden; /* Prevent logo from spilling out */
}

.logo img {
    width: auto;
    height: 100%; /* Fill the height */
    max-width: 100%;
    object-fit: contain; /* Ensure the logo maintains aspect ratio */
    padding: 8px; /* Add padding around the logo */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Top navigation (with logout button) */
.top-nav ul {
    display: flex;
    list-style: none;
    justify-content: flex-end;
}

.top-nav ul li {
    margin-top: 5px;
    margin-left: 20px;
}

.top-nav ul li a {
    color: #6a0dad; /* Purple for contrast on light background */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.top-nav ul li a:hover {
    color: #4b0082; /* Darker purple shade for hover */
}

/* Main content styles */
main {
    flex-grow: 1;
    padding: 0;
    position: relative;
}

main h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #6a0dad; /* Updated to purple */
}

.dashboard-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.description {
    text-align: center;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    color: #6a0dad; /* Updated to purple */
    margin-bottom: 20px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* User display style */
#user-display {
    color: #6a0dad;
    font-size: 14px;
    margin-right: 5px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background-color: #6a0dad; /* Updated to purple */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.login-btn:hover {
    background-color: #4b0082; /* Darker purple shade for hover */
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
    display: none;
}

/* Added styles for password wrapper and toggle icon */
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 32px; /* Adjusted to leave space for the icon inside the input */
}

/* New styles for the toggle password icon image */
.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    cursor: pointer;
}
.toggle-password img {
    margin-top: 10px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Footer styles */
footer {
    background-color: #6a0dad; /* Updated to purple */
    color: #ffffff;
    padding: 1rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: #ecf0f1;
    margin-left: 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #d8bfd8; /* Updated to light purple */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-top .container {
        flex-direction: column;
    }
    
    .logo {
        margin-bottom: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .top-nav ul {
        justify-content: center;
        margin-top: 10px;
    }
    
    .top-nav ul li {
        margin: 0 10px;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links {
        margin-top: 15px;
    }
    
    .social-links a {
        margin: 0 8px;
    }
    
    .dashboard-container iframe {
        height: 100%;
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    nav ul {
        margin-top: 10px;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .main-nav ul {
        flex-direction: row;
        width: 100%;
    }
    
    .main-nav ul li {
        flex: 1;
        text-align: center;
    }
    
    .main-nav ul li a {
        padding: 0 10px;
        font-size: 12px; /* Reduced font size for mobile view */
        height: 40px;
    }
}
