/* Account Page Styles */

/* Hide support button on account page */
.support {
    display: none !important;
}

/* Smooth transitions for authentication state changes */
#login-section, #dashboard-section {
    transition: opacity 0.2s ease-in-out;
}

/* Email input and label transitions */
#login-email, #signup-email,
label[for="login-email"], label[for="signup-email"] {
    transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, margin 0.2s ease-in-out;
}

/* When email inputs are hidden, remove their space */
#login-email[style*="display: none"],
#signup-email[style*="display: none"],
label[for="login-email"][style*="display: none"],
label[for="signup-email"][style*="display: none"] {
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
}

.account-section {
    padding: 100px 0 60px;
    min-height: 90vh;
    background: #1a1a1a;
    position: relative;
    font-family: 'Arial', 'Helvetica', sans-serif;
    z-index: 1; /* Ensure content is below navbar */
}

.account-info {
    width: 100%;
}

/* Ensure waves stay behind content on account page */
.account-section .waves-box {
    z-index: -1;
}

.account-section .waves-box:before,
.account-section .waves-box-inner {
    z-index: -1;
}

.account-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.account-section h1 {
    color: var(--bs-primary);
    font-size: 3.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.account-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    gap: 2.5rem;
    padding: 0 2rem;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .account-content {
        max-width: 100%;
        padding: 0 0.5rem;
        gap: 1.25rem;
    }
}


.account-info h2,
.account-actions h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--bs-primary);
    padding-bottom: 0.75rem;
    letter-spacing: -0.01em;
    position: relative;
}

.account-info h2::after,
.account-actions h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--bs-primary);
    border-radius: 2px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem 2.5rem 2.5rem 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

.profile-card .profile-field {
    padding: 0.6rem 0;
}

.profile-card .button-group {
    margin-top: 1.2rem !important;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    color: #b0b0b0;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.profile-value {
    color: #fff;
    font-weight: 500;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 1.05rem;
}

.account-actions h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.btn-fullwidth {
    width: 100%;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    margin: 0;
}

/* Remove old icon/text styles for compact layout */
.action-icon, .action-text {
    display: none !important;
}

/* Unified actions card styling */
.actions-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    margin: 0 auto 2rem auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.09);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    background: none;
}
@media (max-width: 700px) {
    .button-group {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        justify-content: flex-start;
        padding-top: 1rem;
        margin-top: 2rem;
    }
}


@media (max-width: 700px) {
    .button-group {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Consistent spacing between cards */
.profile-card, .device-card, .actions-card {
    margin-bottom: 2.5rem;
}

/* Remove extra margin from last card */
.account-content > *:last-child .actions-card {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .actions-vertical {
        max-width: 100%;
        gap: 1rem;
    }
    .btn-fullwidth {
        font-size: 1.1rem;
        padding: 1.1rem 1rem;
    }
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.btn-action.btn-primary:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.4);
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb), 0.2);
}

.btn-action.btn-danger:hover {
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.2);
}

.action-icon {
    font-size: 1.5rem;
    min-width: 1.5rem;
    text-align: center;
    opacity: 0.9;
}

.action-text {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Arial', 'Helvetica', sans-serif;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--bs-primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(31, 157, 39, 0.2);
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--bs-primary), white 10%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 157, 39, 0.3);
}

.btn-danger {
    background: var(--amaranth);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(var(--amaranth-rgb), 0.2);
}

.btn-danger:hover {
    background: var(--cardinal);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--amaranth-rgb), 0.3);
}



/* Login Form Styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.login-card,
.signup-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    /* Mobile improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile-specific form improvements */
@media (max-width: 768px) {
    .login-card,
    .signup-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .login-container {
        padding: 1rem;
    }
}

.login-card h2,
.signup-card h2 {
    color: var(--bs-primary);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.login-card form,
.signup-card form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-card label,
.signup-card label {
    color: #b0b0b0;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.login-card input,
.signup-card input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    color: #fff;
    font-size: 1rem;
    font-family: 'Arial', 'Helvetica', sans-serif;
    transition: all 0.3s ease;
    /* Mobile improvements */
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 100%;
    box-sizing: border-box;
}

.login-card input:focus,
.signup-card input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(31, 157, 39, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.login-card input::placeholder,
.signup-card input::placeholder {
    color: #888;
}

.error {
    color: var(--amaranth);
    font-size: 0.9rem;
    text-align: center;
    padding: 0.5rem;
    background: rgba(224, 41, 81, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(224, 41, 81, 0.2);
    display: none; /* Hide by default */
    margin: 0.5rem 0;
    min-height: 1em;
}

.error.show,
.error[style*="block"] {
    display: block !important; /* Force show when JavaScript sets display or adds show class */
}

.error:not(:empty) {
    display: block; /* Show when it has content */
}

.forgot-password-link {
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.forgot-password-link a {
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: #45bc4d;
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #b0b0b0;
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #45bc4d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .account-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .account-section h1 {
        font-size: 2.75rem;
        letter-spacing: -0.015em;
    }
    
    .account-info h2,
    .account-actions h2 {
        font-size: 1.75rem;
    }
    
    .profile-card,
    .action-card {
        padding: 1.5rem;
    }
    
    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Device Management Styles */
.device-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    padding: 1.2rem 1.5rem 1.2rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    width: 100%;
    margin: 0 auto 1.5rem auto;
    box-sizing: border-box;
    color: #fff;
}

.device-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.device-card p {
    font-size: 0.98rem;
    margin-bottom: 0.6rem;
    color: #fff;
}

.device-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    text-transform: uppercase;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .device-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.9rem;
    }
    .device-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.98rem;
    }
}

.device-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
    color: #fff;
}
.device-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.device-name {
    color: #fff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-id {
    color: #b0b0b0;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.device-empty {
    text-align: center;
    color: #fff;
    padding: 2rem;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.device-count-info {
    text-align: center;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-weight: 500;
}



.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
}



.btn-danger {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.6);
}



/* Responsive Device Management */
@media (max-width: 768px) {
    .device-header,
    .device-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: left;
    }
    
    .device-header {
        display: none; /* Hide header on mobile for cleaner look */
    }
    
    .device-item {
        padding: 1rem;
    }
    
    .device-name {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .device-id {
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }
    
    .device-item-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
    
    .actions-compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: none;
    }
    
    .btn-action {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .action-icon {
        font-size: 1.25rem;
        min-width: 1.25rem;
    }
}
