/**
 * Campo Users - CSS Styles
 * Styling for user system components
 */

/* Modal Styles */
.campo-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.campo-modal-content {
    background-color: var(--color-background-default);
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    color: var(--color-text-primary);
}

.campo-modal-large {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.campo-modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid var(--color-border-prominent);
    background: var(--color-background-subtle);
    border-radius: 8px 8px 0 0;
}

.campo-modal-header h2 {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    font-weight: 600;
}

.campo-modal-body {
    padding: 30px;
}

.campo-modal-body h4 {
    color: var(--color-text-primary);
    margin-bottom: 0.5em;
}

.campo-modal-body h4:has(+ #campo-club-search) {
    margin-top: 1em;
}

.campo-close {
    color: var(--color-text-secondary);
    float: right;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 21px;
    margin-top: -8px;
}

.campo-close:hover,
.campo-close:focus {
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Form Styles */
.campo-form-group {
    margin-bottom: 20px;
}

.campo-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.campo-form-group input,
.campo-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border-subtle);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background-color: var(--color-background-subtle);
    color: var(--color-text-secondary);
}

.campo-form-group input:focus,
.campo-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.campo-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.campo-form-row .campo-form-group {
    flex: 1;
    margin-bottom: 0;
}

.campo-form-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

/* Button Styles */
.campo-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.campo-btn-primary {
    background: #007bff;
    color: white;
}

.campo-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.campo-btn-secondary {
    background-color: var(--color-secondary-red-600);
    color: white;
}

.campo-btn-secondary:hover {
    background-color: var(--color-secondary-red-800);
    transform: translateY(-1px);
}

.campo-add-club {
    background-color: var(--color-brand-green-400) !important;
    color: white;
}

.campo-add-club:hover {
    background-color: var(--color-brand-green-600) !important;
    transform: translateY(-1px);
}

.campo-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

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

/* User Menu Styles */
/* User Menu - Minimalistisk Design */
.campo-user-menu-wrapper {
    position: relative;
    display: inline-block;
}

.campo-user-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    color: var(--color-text-primary);
    opacity: 0.02;
}

.campo-user-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.campo-user-icon svg {
    display: block;
    stroke: var(--color-text-primary);
}

.campo-user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.campo-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.campo-dropdown-header .campo-user-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.campo-dropdown-header .campo-user-email {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.campo-dropdown-items {
    padding: 5px 0;
}

.campo-dropdown-item {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
    font-size: 0.95rem;
    text-align: left;
}

.campo-dropdown-item:hover {
    background-color: #f0f0f0;
}

.campo-dropdown-item.campo-logout {
    color: #dc3545;
}

.campo-dropdown-item.campo-logout:hover {
    background-color: #fff5f5;
}

.campo-dropdown-item svg {
    flex-shrink: 0;
}

/* Dark mode toggle */
.campo-darkmode-toggle {
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    padding-bottom: 12px;
}

.campo-darkmode-toggle .campo-icon-light,
.campo-darkmode-toggle .campo-icon-dark {
    display: none;
}

.campo-user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
}

.campo-user-name {
    font-weight: 600;
    color: #333;
}

.campo-user-menu-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

/* Header User Menu */
.campo-header-user-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 35;
}

.campo-header-user-menu .campo-user-name {
    color: #333;
    font-size: 0.9rem;
    display: none; /* Hide name on mobile */
}

.campo-header-user-menu .campo-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.campo-header-user-menu .campo-btn-small {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Follow Club Button */
.campo-follow-club {
    margin: 20px 0;
    text-align: center;
}

.campo-follow-club .campo-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    min-width: 200px;
}

/* Temporary Message */
#campo-temp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 300px;
}

@media (min-width: 768px) {
    .campo-header-user-menu .campo-user-name {
        display: block; /* Show name on desktop */
    }
}

@media (max-width: 767px) {
    .campo-header-user-menu {
        gap: 5px;
    }
    
    .campo-header-user-menu .campo-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .campo-follow-club .campo-btn {
        width: 100%;
        padding: 15px;
    }
}

/* Profile Tabs */
.campo-profile-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border-prominent);
    margin-bottom: 25px;
    gap: 5px;
}

.campo-tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 5px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
}

.campo-tab-button.active {
    color: var(--color-text-primary);
    border-bottom-color: var(--color-border-active);
}

.campo-tab-button:hover {
    color: var(--color-text-primary);
}

.campo-tab-content {
    display: none;
}

.campo-tab-content.active {
    display: block;
}

/* Club Styles */
.campo-clubs-section h3 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.campo-club-search {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border-subtle);
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 20px;
    background-color: var(--color-background-subtle);
    color: var(--color-text-secondary);
}

.campo-club-search input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border-subtle);
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: var(--color-background-subtle);
    color: var(--color-text-secondary);
}

.campo-club-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 10px;
}

.campo-club-item {
    display: flex;
    align-items: center;
    background-color: var(--color-background-subtle);
    padding: 6px 6px 6px 10px;
    border-radius: 6px;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 5px;
    transition: opacity 0.2s ease;
    color: var(--color-text-primary);
}

.campo-club-item:hover {
    opacity: 0.8;
}

.campo-club-item:last-child {
    border-bottom: none;
}

.campo-club-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.campo-club-logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
}

.campo-club-name {
    flex: 1;
    font-weight: 600;
    color: var(--color-text-primary);
}

.campo-item-type {
    font-size: 0.85em;
    font-weight: 400;
    color: #666;
    opacity: 0.8;
}

.campo-selected-clubs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.campo-selected-club {
    display: flex;
    align-items: center;
    background-color: var(--color-background-prominent);
    padding: 6px 6px 6px 10px;
    border-radius: 6px;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--color-text-primary);
}

.campo-selected-club .campo-club-logo {
    width: 24px;
    height: 24px;
}

/* Profile Display Styles */
.campo-user-profile-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.campo-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.campo-profile-header h2 {
    margin: 0;
    color: #333;
}

.campo-profile-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.campo-profile-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.campo-favorite-clubs-display {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.campo-club-badge {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 8px;
    font-weight: 600;
    color: #333;
}

.campo-club-badge img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
}

/* Notifications Section */
.campo-notifications-section {
    padding: 20px 0;
}

.campo-notifications-section label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    margin-bottom: 15px;
}

.campo-notifications-section input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
}

#onesignal-status {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-weight: 500;
}

/* Device Management */
.campo-devices {
    margin-top: 15px;
}

.campo-device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--color-background-subtle);
    border: 2px solid var(--color-border-subtle);
    border-radius: 6px;
    margin-bottom: 10px;
}

.campo-device-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.campo-device-icon {
    font-size: 24px;
}

.campo-device-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.campo-device-details strong {
    color: var(--color-text-primary);
    font-size: 15px;
}

.campo-device-details small {
    font-size: 13px;
}

.campo-device-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.campo-device-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-primary);
    cursor: pointer;
}

.campo-device-toggle input[type="checkbox"] {
    width: auto;
    transform: scale(1.1);
}

.campo-device-remove {
    background: var(--color-secondary-red-600);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.campo-device-remove:hover {
    background: var(--color-secondary-red-800);
}

.campo-device-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: var(--color-primary-600);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.campo-device-add-btn:hover {
    background: var(--color-primary-800);
}

.campo-add-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .campo-device-actions {
        gap: 8px;
    }
    
    .campo-device-toggle span.campo-toggle-label {
        display: none;
    }
    
    .campo-device-toggle {
        gap: 0;
    }
    
    .campo-device-remove {
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
    
    .campo-add-label {
        display: none;
    }
    
    .campo-device-add-btn {
        width: auto;
        align-self: flex-end;
        padding: 10px 16px;
        border-radius: 50%;
        min-width: 44px;
        min-height: 44px;
    }
    
    .campo-add-icon {
        font-size: 24px;
    }
}

/* Message Styles */
.campo-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
}

.campo-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
}

/* Inline Forms */
.campo-login-form-container,
.campo-register-form-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.campo-login-form h3,
.campo-register-form h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .campo-modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .campo-modal-body {
        padding: 20px;
    }
    
    .campo-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .campo-form-row .campo-form-group {
        margin-bottom: 20px;
    }
    
    .campo-form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .campo-user-menu {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .campo-profile-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .campo-profile-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .campo-tab-button {
        flex: 1;
        min-width: 120px;
    }
    
    .campo-club-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .campo-favorite-clubs-display {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .campo-modal-content {
        margin: 5% auto;
        width: 98%;
    }
    
    .campo-btn {
        width: 100%;
        justify-content: center;
    }
    
    .campo-form-actions .campo-btn {
        flex: 1;
    }
    
    .campo-club-logo {
        width: 32px;
        height: 32px;
    }
    
    .campo-profile-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .campo-tab-button {
        min-width: 100px;
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .campo-modal-content {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .campo-form-group input,
    .campo-form-group textarea {
        background-color: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .campo-form-group input:focus,
    .campo-form-group textarea:focus {
        border-color: #667eea;
        background-color: #4a5568;
    }
    
    .campo-club-item:hover {
        background-color: #4a5568;
    }
    
    .campo-profile-section {
        background-color: #4a5568;
    }
    
    .campo-club-badge {
        background-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Password Reset Styles */
.campo-forgot-password {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
}

.campo-forgot-password:hover {
    color: #3182ce;
    text-decoration: underline;
}

.campo-password-section {
    padding: 20px;
}

.campo-password-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

/* Message styling for password forms */
#campo-password-message,
#campo-forgot-password-message,
#campo-change-password-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#campo-password-message.success,
#campo-forgot-password-message.success,
#campo-change-password-message.success {
    background-color: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

#campo-password-message.error,
#campo-forgot-password-message.error,
#campo-change-password-message.error {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* Temporary message transitions */
#campo-temp-message {
    transition: opacity 0.3s ease-in-out;
}

#campo-temp-message.campo-success {
    background-color: #48bb78;
    color: white;
}

#campo-temp-message.campo-error {
    background-color: #f56565;
    color: white;
}

#campo-temp-message.campo-info {
    background-color: #4299e1;
    color: white;
}

/* Social Login Styles */
.campo-social-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #666;
    font-size: 14px;
}

.campo-social-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.campo-social-divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.campo-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.campo-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.campo-social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.campo-google-btn {
    border-color: #4285F4;
}

.campo-google-btn:hover {
    background: #f8f9ff;
    border-color: #3367d6;
}

.campo-facebook-btn {
    border-color: #1877F2;
}

.campo-facebook-btn:hover {
    background: #f0f4ff;
    border-color: #166fe5;
}

.campo-apple-btn {
    border-color: #000;
    color: #000;
}

.campo-apple-btn:hover {
    background: #f8f8f8;
    border-color: #333;
}

.campo-social-btn svg {
    flex-shrink: 0;
}

/* Responsive social buttons */
@media (min-width: 480px) {
    .campo-social-buttons {
        flex-direction: row;
    }
    
    .campo-social-btn {
        flex: 1;
        font-size: 13px;
        padding: 10px 15px;
    }
}