/**
 * ROeID Authentication Styles
 * Following ROeID brand guidelines
 */

/* ROeID Color Palette */
:root {
    --roeid-black: #000000;
    --roeid-button-hover: #09338a;
    --roeid-royal-blue: #2e5ae6;
    --roeid-cornflower-blue: #8298db;
    --roeid-light-gray: #f4f4f4;
    --roeid-goldenrod: #f2b62c;
    --roeid-ghost-white: #f1f3f8;
    --roeid-levender: #d1d9e8;
}

/* Login Button Wrapper */
.roeid-login-wrapper {
    margin: 20px 0;
    text-align: center;
}

/* User Menu Wrapper */
.roeid-user-menu-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

/* User Menu Button */
.roeid-user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--roeid-royal-blue) 0%, #3b82f6 100%);
    color: white;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 90, 230, 0.2);
    user-select: none;
}

.roeid-user-menu-button:hover {
    background: linear-gradient(135deg, var(--roeid-button-hover) 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(9, 51, 138, 0.3);
    transform: translateY(-1px);
}

.roeid-user-avatar {
    display: flex;
    align-items: center;
    line-height: 0;
}

.roeid-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.roeid-user-name {
    font-size: 15px;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roeid-dropdown-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.roeid-user-menu-wrapper:hover .roeid-dropdown-icon {
    transform: rotate(180deg);
}

/* User Dropdown */
.roeid-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.roeid-user-menu-wrapper:hover .roeid-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.roeid-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.roeid-dropdown-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--roeid-ghost-white);
}

.roeid-dropdown-info {
    flex: 1;
    min-width: 0;
}

.roeid-dropdown-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roeid-dropdown-email {
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Divider */
.roeid-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 8px;
}

/* Dropdown Menu */
.roeid-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.roeid-dropdown-menu li {
    margin: 0;
}

.roeid-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.roeid-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.roeid-dropdown-item:hover {
    background: var(--roeid-ghost-white);
    color: var(--roeid-royal-blue);
    text-decoration: none;
}

.roeid-dropdown-item:hover svg {
    opacity: 1;
}

.roeid-dropdown-item.roeid-logout-full {
    color: #dc2626;
}

.roeid-dropdown-item.roeid-logout-full:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* Arrow pointer for dropdown */
.roeid-user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

/* ROeID Login Button */
.roeid-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 32px;
    background-color: var(--roeid-royal-blue);
    color: #ffffff;
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 90, 230, 0.2);
}

.roeid-login-button:hover {
    background-color: var(--roeid-button-hover);
    box-shadow: 0 4px 12px rgba(9, 51, 138, 0.3);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.roeid-login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(9, 51, 138, 0.3);
}

/* ROeID Logo in Button */
.roeid-login-button .roeid-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Disclaimer Text */
.roeid-disclaimer {
    margin-top: 20px;
    padding: 16px;
    background-color: var(--roeid-ghost-white);
    border-left: 4px solid var(--roeid-royal-blue);
    border-radius: 4px;
    text-align: left;
}

.roeid-disclaimer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.roeid-disclaimer a {
    color: var(--roeid-royal-blue);
    text-decoration: none;
    font-weight: 500;
}

.roeid-disclaimer a:hover {
    text-decoration: underline;
}

/* WordPress Login Page Integration */
.roeid-wp-login {
    margin-bottom: 20px;
}

.roeid-separator {
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.roeid-separator::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: #ddd;
}

.roeid-separator span {
    position: relative;
    background-color: #fff;
    padding: 0 10px;
    color: #999;
    font-size: 14px;
}

/* Widget Styles */
.widget_roeid_login_widget {
    text-align: center;
}

.widget_roeid_login_widget .roeid-login-wrapper {
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .roeid-user-menu-button {
        padding: 6px 12px;
    }

    .roeid-user-name {
        max-width: 100px;
        font-size: 14px;
    }

    .roeid-user-dropdown {
        min-width: 260px;
        right: -10px;
    }

    .roeid-user-dropdown::before {
        right: 25px;
    }
}

@media (max-width: 480px) {
    .roeid-login-button {
        width: 100%;
        padding: 12px 24px;
        font-size: 15px;
    }

    .roeid-disclaimer {
        font-size: 12px;
    }

    .roeid-user-menu-wrapper {
        display: block;
        width: 100%;
    }

    .roeid-user-menu-button {
        width: 100%;
        justify-content: center;
    }

    .roeid-user-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
        width: calc(100% - 20px);
        margin: 0 10px;
    }

    .roeid-user-dropdown::before {
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(45deg);
    }

    .roeid-user-name {
        max-width: 120px;
    }
}

/* Loading State */
.roeid-login-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.roeid-login-button.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: roeid-spin 0.6s linear infinite;
}

@keyframes roeid-spin {
    to { transform: rotate(360deg); }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .roeid-disclaimer {
        background-color: rgba(46, 90, 230, 0.1);
        color: #ddd;
    }

    .roeid-disclaimer p {
        color: #ccc;
    }

    .roeid-separator::before {
        background-color: #444;
    }

    .roeid-separator span {
        background-color: #1e1e1e;
        color: #888;
    }
}

/* Admin Profile Styles */
.user-profile-picture + h3 {
    margin-top: 30px;
}

table.form-table th {
    width: 200px;
}

/* Status Indicator */
.roeid-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #46b450;
    margin-right: 6px;
}
