/**
 * Jeddle SSO Login Styles
 * 
 * Modern, clean styling for SSO login buttons and school selector
 */

/* Container */
.jeddle-sso-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Header */
.jeddle-sso-header {
    text-align: center;
    margin-bottom: 32px;
}

.jeddle-sso-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.jeddle-sso-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Buttons Base */
.jeddle-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-sizing: border-box;
}

.jeddle-sso-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jeddle-sso-btn:active {
    transform: translateY(0);
}

/* Icon */
.jeddle-sso-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google Button */
.jeddle-sso-btn-google {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.jeddle-sso-btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
}

/* Microsoft Button */
.jeddle-sso-btn-microsoft {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.jeddle-sso-btn-microsoft:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
}

/* School Button */
.jeddle-sso-btn-school {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #ffffff;
    margin-top: 8px;
}

.jeddle-sso-btn-school:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
}

.jeddle-sso-chevron {
    width: 20px;
    height: 20px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.jeddle-sso-btn-school.active .jeddle-sso-chevron {
    transform: rotate(180deg);
}

/* Primary Button */
.jeddle-sso-btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #ffffff;
}

.jeddle-sso-btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
}

/* Secondary Button */
.jeddle-sso-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.jeddle-sso-btn-secondary:hover {
    background: #e5e7eb;
}

/* Detect Button */
.jeddle-sso-btn-detect {
    background: #7c3aed;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    width: auto;
}

.jeddle-sso-btn-detect:hover {
    background: #6d28d9;
}

/* Social Section */
.jeddle-sso-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Divider */
.jeddle-sso-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.jeddle-sso-divider::before,
.jeddle-sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.jeddle-sso-divider span {
    padding: 0 16px;
    color: #9ca3af;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* School Selector */
.jeddle-sso-school-selector {
    margin-top: 16px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input */
.jeddle-sso-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.jeddle-sso-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.jeddle-sso-input::placeholder {
    color: #9ca3af;
}

/* School Dropdown */
.jeddle-sso-school-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.jeddle-sso-school-search {
    position: relative;
}

.jeddle-sso-school-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.jeddle-sso-school-item:hover {
    background: #f3f4f6;
}

.jeddle-sso-school-item:first-child {
    border-radius: 8px 8px 0 0;
}

.jeddle-sso-school-item:last-child {
    border-radius: 0 0 8px 8px;
}

.jeddle-sso-school-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #e5e7eb;
}

.jeddle-sso-school-name {
    font-weight: 500;
    color: #1f2937;
}

.jeddle-sso-school-domain {
    font-size: 13px;
    color: #6b7280;
}

.jeddle-sso-no-results {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* Email Detect */
.jeddle-sso-email-detect {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.jeddle-sso-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.jeddle-sso-email-detect .jeddle-sso-input {
    margin-bottom: 12px;
}

/* Email/Password Login Form */
.jeddle-sso-email-login {
    margin-top: 0;
}

.jeddle-sso-email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jeddle-sso-form-group {
    width: 100%;
}

.jeddle-sso-form-group input {
    width: 100%;
}

/* Password field with eye icon */
.jeddle-sso-password-wrapper {
    position: relative;
}

.jeddle-sso-input-password {
    padding-right: 48px;
}

.jeddle-sso-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.jeddle-sso-password-toggle:hover {
    color: #6b7280;
}

.jeddle-sso-password-toggle:focus {
    outline: none;
    color: #7c3aed;
}

.jeddle-sso-eye-icon {
    width: 20px;
    height: 20px;
}

/* Save password checkbox */
.jeddle-sso-save-password {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.jeddle-sso-save-password input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #7c3aed;
}

.jeddle-sso-btn-email {
    margin-top: 4px;
}

.jeddle-sso-forgot {
    text-align: center;
    margin: 8px 0 0 0;
    font-size: 13px;
}

.jeddle-sso-forgot a {
    color: #7c3aed;
    text-decoration: none;
}

.jeddle-sso-forgot a:hover {
    text-decoration: underline;
}

/* Footer */
.jeddle-sso-footer {
    margin-top: 24px;
    text-align: center;
}

.jeddle-sso-footer p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.jeddle-sso-footer p+p {
    margin-top: 8px;
}

.jeddle-sso-footer a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
}

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

/* Logged In State */
.jeddle-sso-logged-in {
    text-align: center;
}

.jeddle-sso-logged-in p {
    font-size: 16px;
    color: #374151;
    margin-bottom: 20px;
}

.jeddle-sso-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Error Message */
.jeddle-sso-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
}

/* Loading Overlay */
.jeddle-sso-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 200;
}

.jeddle-sso-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.jeddle-sso-loading p {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .jeddle-sso-container {
        margin: 20px;
        padding: 30px 20px;
    }

    .jeddle-sso-header h2 {
        font-size: 24px;
    }
}
