/* src/styles/styles.css */

/* ---------------------------
   1. Global Theme Variables
   --------------------------- */

/* Light Theme Variables */
:root {
    --background-color: #f0f4f8;
    --text-color: #333333;
    --card-background-color: #ffffff;
    --input-background-color: #ffffff;
    --input-border-color: #cccccc;
    --input-text-color: #333333;
    --placeholder-color: #888888;
    --focus-border-color: #4a90e2;
    --error-color: #e74c3c;
    --button-background-color: #4a90e2;
    --button-text-color: #ffffff;
    --button-hover-background-color: #357ab8;
    --divider-color: #e0e0e0;
    --divider-text-color: #666666;
    --toggle-icon-color: #333333;
    --illustration-opacity: 1;
}

/* Dark Theme Variables */
.dark-theme {
    --background-color: #121212;
    --text-color: #e0e0e0;
    --card-background-color: #1e1e1e;
    --input-background-color: #2c2c2c;
    --input-border-color: #555555;
    --input-text-color: #e0e0e0;
    --placeholder-color: #aaaaaa;
    --focus-border-color: #4a90e2;
    --error-color: #f56565;
    --button-background-color: #4a90e2;
    --button-text-color: #ffffff;
    --button-hover-background-color: #357ab8;
    --divider-color: #555555;
    --divider-text-color: #a0aec0;
    --toggle-icon-color: #e0e0e0;
    --illustration-opacity: 0.8;
}

/* ---------------------------
   2. Global Styles
   --------------------------- */

body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Accessible hidden label */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global button styles */
button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: var(--button-hover-background-color);
}

button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

/* ---------------------------
   3. Login Page Styles
   --------------------------- */

/* Container to center the login card */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90vh;
    padding: 20px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

/* Login card styling */
.login-card {
    background-color: var(--card-background-color);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Illustration styling */
.login-illustration {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 150px;
    height: 150px;
    opacity: var(--illustration-opacity);
    transition: opacity 0.3s ease;
}

/* Login header to position the title and theme toggle */
.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Login title */
.login-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Form styling */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input group styling */
.input-group {
    position: relative;
    width: 100%;
}

/* Input icon styling */
.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--input-border-color);
    font-size: 18px;
}

/* Input field styling */
.login-input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--input-background-color);
    color: var(--input-text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-input::placeholder {
    color: var(--placeholder-color);
}

.login-input:focus {
    border-color: var(--focus-border-color);
    outline: none;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

/* Error message styling */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    text-align: left;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Button group styling */
.button-group {
    display: flex;
    justify-content: center;
}

/* Login button styling */
.login-button {
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    border: none;
    padding: 14px 0;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.login-button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.login-button:hover:not(:disabled) {
    background-color: var(--button-hover-background-color);
    transform: translateY(-2px);
}

/* Spinner styling */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--button-text-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider styling */
.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--divider-color);
}

.divider::before {
    margin-right: 10px;
}

.divider::after {
    margin-left: 10px;
}

.divider span {
    color: var(--divider-text-color);
    font-size: 14px;
}

/* Social login buttons styling */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--divider-color);
    background-color: transparent;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-button:hover {
    background-color: var(--button-background-color);
    color: var(--button-text-color);
}

/* Specific social button colors */
.facebook-button {
    border-color: #3b5998;
}

.facebook-button:hover {
    background-color: #3b5998;
    color: #ffffff;
}

.google-button {
    border-color: #db4437;
}

.google-button:hover {
    background-color: #db4437;
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-button {
        font-size: 14px;
        padding: 12px 0;
    }

    .login-input {
        font-size: 14px;
        padding: 10px 10px 10px 35px;
    }

    .input-icon {
        font-size: 16px;
        left: 12px;
    }

    .login-illustration {
        width: 100px;
        height: 100px;
    }
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

/* Auth card styling */
.auth-card {
    background-color: var(--card-background-color);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Auth title */
.auth-title {
    font-size: 28px;
    margin: 0 0 30px 0;
    color: var(--text-color);
}

/* Form styling */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input group styling */
.input-group {
    position: relative;
    width: 100%;
}

/* Input icon styling */
.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--input-border-color);
    font-size: 18px;
}

/* Input field styling */
.auth-input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--input-border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--input-background-color);
    color: var(--input-text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-input::placeholder {
    color: var(--placeholder-color);
}

.auth-input:focus {
    border-color: var(--focus-border-color);
    outline: none;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

/* Error message styling */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    text-align: left;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Button group styling */
.button-group {
    display: flex;
    justify-content: center;
}

/* Submit button styling */
.submit-button {
    background-color: var(--button-background-color);
    color: var(--button-text-color);
    border: none;
    padding: 14px 0;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.submit-button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.submit-button:hover:not(:disabled) {
    background-color: var(--button-hover-background-color);
    transform: translateY(-2px);
}

/* Spinner styling */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--button-text-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider styling */
.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--divider-color);
}

.divider::before {
    margin-right: 10px;
}

.divider::after {
    margin-left: 10px;
}

.divider span {
    color: var(--divider-text-color);
    font-size: 14px;
}

/* Redirect text styling */
.redirect-text {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-color);
}

.redirect-text a {
    color: var(--button-background-color);
    text-decoration: none;
    font-weight: bold;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

    .auth-title {
        font-size: 24px;
    }

    .submit-button {
        font-size: 14px;
        padding: 12px 0;
    }

    .auth-input {
        font-size: 14px;
        padding: 10px 10px 10px 35px;
    }

    .input-icon {
        font-size: 16px;
        left: 12px;
    }
}


/* ---------------------------
   3. Profile Page Specific Styles
--------------------------- */

/* Container to center the profile card */
.profile-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

/* Profile card styling */
.profile-card {
    background-color: var(--card-background-color);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Spinner icon styling */
.spinner-icon {
    color: var(--button-text-color);
}

/* Avatar styling */
.avatar {
    margin-bottom: 20px;
    color: var(--button-background-color);
}

/* Profile Information */
.profile-info {
    margin-bottom: 30px;
}

.profile-name {
    font-size: 24px;
    margin: 10px 0;
    color: var(--text-color);
}

.profile-email,
.profile-role {
    font-size: 16px;
    margin: 5px 0;
    color: var(--text-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.edit-button,
.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.edit-button {
    background-color: #f0ad4e; /* Orange */
    color: #ffffff;
}

.edit-button:hover {
    background-color: #ec971f;
}

.logout-button {
    background-color: #d9534f; /* Red */
    color: #ffffff;
}

.logout-button:hover {
    background-color: #c9302c;
}

/* Divider styling */
.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--divider-color);
}

.divider::before {
    margin-right: 10px;
}

.divider::after {
    margin-left: 10px;
}

.divider span {
    color: var(--divider-text-color);
    font-size: 14px;
}

/* Error message styling */
.error-message {
    color: var(--error-color);
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .profile-card {
        padding: 30px 20px;
    }

    .profile-name {
        font-size: 20px;
    }

    .profile-email,
    .profile-role {
        font-size: 14px;
    }

    .edit-button,
    .logout-button {
        font-size: 14px;
        padding: 10px 0;
    }
}