/**
 * CourseExplorer Authentication Styles
 */

/* CSS Variables for theming */
:root {
    --ce-primary-color: #2271b1;
    --ce-secondary-color: #646970;
    --ce-success-color: #28a745;
    --ce-error-color: #dc3545;
    --ce-warning-color: #ffc107;
    --ce-light-bg: #f8f9fa;
    --ce-border-color: #ddd;
    --ce-border-radius: 5px;
    --ce-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --ce-transition: all 0.3s ease;
}

/* Page Container */
.ce-page-container {
    min-height: 60vh;
    padding: 2rem 0;
}

/* Auth Form Container */
.ce-auth-form-container {
    background: white;
    border-radius: var(--ce-border-radius);
    box-shadow: var(--ce-shadow);
    padding: 2rem;
    margin: 2rem 0;
}

.ce-page-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--ce-primary-color);
    font-size: 2rem;
    font-weight: 600;
}

/* Form Styles */
.ce-auth-form {
    max-width: 100%;
}

.ce-form-group {
    margin-bottom: 1.5rem;
}

.ce-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--ce-secondary-color);
}

.ce-form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--ce-border-color);
    border-radius: var(--ce-border-radius);
    font-size: 1rem;
    transition: var(--ce-transition);
    box-sizing: border-box;
}

.ce-form-control:focus {
    outline: none;
    border-color: var(--ce-primary-color);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ce-form-control.error {
    border-color: var(--ce-error-color);
}

.ce-form-text {
    font-size: 0.875rem;
    color: var(--ce-secondary-color);
    margin-top: 0.25rem;
}

/* Buttons */
.ce-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--ce-border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--ce-transition);
    min-width: 120px;
}

.ce-btn-primary {
    background: var(--ce-primary-color);
    color: white;
}

.ce-btn-primary:hover {
    background: #1e5a8a;
    transform: translateY(-1px);
}

.ce-btn-secondary {
    background: var(--ce-secondary-color);
    color: white;
}

.ce-btn-secondary:hover {
    background: #5a5f66;
}

.ce-btn-outline {
    background: transparent;
    color: var(--ce-primary-color);
    border: 2px solid var(--ce-primary-color);
}

.ce-btn-outline:hover {
    background: var(--ce-primary-color);
    color: white;
}

.ce-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Actions */
.ce-form-actions {
    text-align: center;
    margin: 2rem 0;
}

.ce-form-actions .ce-btn {
    margin: 0 0.5rem;
}

/* Auth Links */
.ce-auth-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ce-border-color);
}

.ce-auth-links .ce-link {
    display: block;
    margin: 0.5rem 0;
    color: var(--ce-primary-color);
    text-decoration: none;
    transition: var(--ce-transition);
}

.ce-auth-links .ce-link:hover {
    text-decoration: underline;
}

/* Messages */
.ce-messages {
    margin-bottom: 1.5rem;
}

.ce-message {
    padding: 0.75rem 1rem;
    border-radius: var(--ce-border-radius);
    margin-bottom: 1rem;
}

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

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

.ce-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ce-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Profile Page */
.ce-profile-page {
    padding: 2rem 0;
}

.ce-profile-container {
    background: white;
    border-radius: var(--ce-border-radius);
    box-shadow: var(--ce-shadow);
    padding: 2rem;
}

.ce-profile-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ce-border-color);
}

.ce-profile-header h2 {
    margin: 0 0 0.5rem;
    color: var(--ce-primary-color);
}

.ce-profile-email {
    color: var(--ce-secondary-color);
    margin: 0;
}

.ce-profile-details {
    margin: 2rem 0;
}

.ce-profile-field {
    margin-bottom: 1rem;
}

.ce-profile-field label {
    display: block;
    font-weight: 600;
    color: var(--ce-secondary-color);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.ce-profile-field span {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ce-border-color);
}

.ce-profile-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ce-border-color);
}

.ce-profile-actions .ce-btn {
    margin: 0 0.5rem;
}

/* Profile Sidebar */
.ce-profile-sidebar {
    margin-top: 2rem;
}

.ce-profile-widget {
    background: white;
    border-radius: var(--ce-border-radius);
    box-shadow: var(--ce-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ce-profile-widget h3 {
    margin: 0 0 1rem;
    color: var(--ce-primary-color);
    font-size: 1.2rem;
}

.ce-account-status .ce-status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.ce-status-label {
    font-weight: 600;
    color: var(--ce-secondary-color);
}

.ce-status-value.verified {
    color: var(--ce-success-color);
    font-weight: 600;
}

.ce-status-value.unverified {
    color: var(--ce-error-color);
    font-weight: 600;
}

/* Loading States */
.ce-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.ce-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--ce-border-color);
    border-top: 2px solid var(--ce-primary-color);
    border-radius: 50%;
    animation: ce-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .ce-auth-form-container {
        margin: 1rem 0;
        padding: 1.5rem;
    }

    .ce-page-title {
        font-size: 1.5rem;
    }

    .ce-btn {
        width: 100%;
        margin: 0.25rem 0;
    }

    .ce-profile-sidebar {
        margin-top: 1rem;
    }
}

/* Bootstrap Grid Compatibility */
@media (min-width: 768px) {
    .ce-profile-sidebar {
        margin-top: 2rem;
    }
}

/* Form Error States */
.ce-form-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: var(--ce-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.ce-form-errors ul {
    margin: 0;
    padding-left: 1.5rem;
}

.ce-form-errors li {
    margin-bottom: 0.25rem;
}

/* Success Animation */
.ce-success-animation {
    animation: ce-fadeInUp 0.5s ease-out;
}

@keyframes ce-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus trap for modals */
.ce-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ce-modal {
    background: white;
    border-radius: var(--ce-border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Dynamic color application */
.ce-theme-colors {
    --ce-primary-color: var(--ce-dynamic-primary, #2271b1);
    --ce-secondary-color: var(--ce-dynamic-secondary, #646970);
}
