/*
================================================================
||
||  Serensip Child Theme - Optimized Security Hub Styles
||  Version: 2.0
||  Description: Consolidates all page-specific styles,
||               removes duplicates, and organizes rules
||               for maintainability.
||
================================================================
*/


/*
==============================================
--- 1. GRID & CARD LAYOUT ---
==============================================
*/

.security-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.security-hub-grid .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.security-hub-grid .card .card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* DEPRECATED - This class might not be in use, but style is preserved */
.security-hub-grid .card .card-actions {
    margin-top: auto;
}

.card-header .icon {
    flex-shrink: 0;
}


/*
==============================================
--- 2. CORE COMPONENTS ---
==============================================
*/

/* --- Component: Setting Row --- */

/* This is the main container for each setting row.
   Paddings from original and refinement blocks are merged. */
.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0 0; /* Combines `padding: 1.25rem 0` and `padding-bottom: 0` */
}

/* This creates a single, clean divider line ABOVE every row except the first one. */
.setting-row + .setting-row,
.activity-log ul li + li,
.security-checklist ul li + li {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
    color: var(--accent-color);
}

.setting-row-icon .feather {
    width: 20px;
    height: 20px;
}

.setting-row .info {
    flex-grow: 1;
}

.setting-row .info h4 {
    font-size: 1rem;
    margin: 0;
}

.setting-row .info p {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    margin: 0.25rem 0 0 0;
}

.setting-row .action {
    margin-left: auto;
}


/* --- Component: Security Checklist --- */

.security-checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-checklist li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0; /* Merged from refinement section */
}

.security-checklist .icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.security-checklist .status-complete .icon-wrapper {
    background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
    color: var(--accent-color);
}

.security-checklist .status-incomplete .icon-wrapper {
    background-color: var(--border-color);
    color: var(--text-secondary-color);
}

.security-checklist .info h4 {
    font-size: 1rem;
    margin: 0;
}

.security-checklist .info p {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    margin: 0.25rem 0 0 0;
}


/* --- Component: Action Links (Button Style) --- */

/* This is the merged and final style for all action links in cards. */
.security-checklist a,
.setting-row .action a {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none !important;
    color: var(--text-color) !important;
    background-color: #fdfdfd;
    transition: all 0.3s;
}

.security-checklist a:hover,
.setting-row .action a:hover {
    border-color: var(--accent-color);
    background-color: color-mix(in srgb, var(--accent-color) 5%, transparent);
}


/* --- Component: Toggle Switch --- */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 28px;
    transition: .4s;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}
input:checked + .toggle-slider {
    background-color: var(--accent-color);
}
input:checked + .toggle-slider:before {
    transform: translateX(22px);
}


/*
==============================================
--- 3. COMPONENT STATES & MODIFIERS ---
==============================================
*/

/* --- State: Account Status Danger Row --- */

.setting-row.danger .setting-row-icon {
    background-color: color-mix(in srgb, var(--danger-color) 10%, transparent);
    color: var(--danger-color);
}

.setting-row.danger .info h4 {
    color: var(--text-color);
}

.setting-row.danger .action a {
    border-color: var(--danger-hover-color);
    background-color: var(--danger-color);
    color: #fff !important;
}

.setting-row.danger .action a:hover {
    border-color: var(--danger-hover-color);
    background-color: var(--danger-hover-color);
    color: #fff !important;
}


/*
==============================================
--- 4. MODALS ---
==============================================
*/

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.3s ease-in-out;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content p {
    color: var(--text-secondary-color);
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* --- Specific Modal Buttons (#confirm-modal) --- */

#confirm-modal .btn-secondary,
#confirm-modal .modal-btn-danger,
.modal-btn-danger { /* General class for other modals */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s;
}

#confirm-modal .btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-color) !important;
    border-color: var(--border-color);
}

#confirm-modal .btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary-color);
}

#confirm-modal .modal-btn-danger,
.modal-btn-danger { /* General class for other modals */
    background-color: var(--danger-color);
    color: #fff !important;
    border-color: var(--danger-color);
}

#confirm-modal .modal-btn-danger:hover,
.modal-btn-danger:hover {
    opacity: 0.85;
}

/* This style for the cancel button was more specific than the generic .btn-secondary */
#confirm-modal #cancel-modal-btn {
    background-color: #ffffff;
    border-color: #dcdcdc;
    color: var(--text-color);
}

#confirm-modal #cancel-modal-btn:hover {
    background-color: #f7f7f7;
    border-color: #c5c5c5;
}

/* This style is identical to `.modal-btn-danger` but preserved for specificity */
#confirm-modal #confirm-signout-btn {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #ffffff;
}

#confirm-modal #confirm-signout-btn:hover {
    opacity: 0.85;
}


/*
==============================================
--- 5. LEGACY / POTENTIALLY UNUSED STYLES ---
--- (Preserved to prevent breaking changes) ---
==============================================
*/

/* --- Component: Sign-in Activity List --- */

.activity-log ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-log li {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-log li:last-child {
    border-bottom: none;
}
.activity-log .log-icon {
    color: var(--text-secondary-color);
}
.activity-log .log-details h4 {
    font-size: 1rem;
    margin: 0;
}
.activity-log .log-details p {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
    margin: 0.25rem 0 0 0;
}
.activity-log .log-status {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
}


/* --- Component: Danger Zone --- */
/* The two conflicting .danger-zone-content rules have been merged.
   The second, more descriptive rule (flex-direction: column) was prioritized. */
.danger-zone-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.danger-zone-content p {
    margin: 0;
    line-height: 1.6;
}

.danger-zone-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
}


/*
==============================================
--- 6. RESPONSIVE MEDIA QUERIES ---
==============================================
*/

@media (max-width: 980px) {
    .security-hub-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Legacy style, preserved. */
    .danger-zone-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .danger-zone-content .btn-danger {
        width: 100%;
    }
}

@media (max-width: 500px) {
    /* Legacy style, preserved. */
    .danger-zone-actions {
        flex-direction: column;
    }
    .danger-zone-actions .btn {
        width: 100%;
    }
}
/* --- CUSTOM REFINEMENT: Reduce space below card titles --- */
.security-hub-grid .card .card-header {
    margin-bottom: 0.2rem; /* Adjust this value as needed */
}
/*
================================================================
||
||  Serensip Child Theme - Additions for New Security Hub Mockup
||
================================================================
*/

/*
==============================================
--- NEW ICONS & REFINED ROWS ---
==============================================
*/

/* We are reusing .setting-row, which is great.
   This just ensures the vertical alignment is perfect
   if content wraps on small screens. */
.setting-row {
    align-items: center; /* Changed from 'center' to 'flex-start' for better alignment on wrap */
}

/* Add a bit more space between the icon and the text */
.setting-row-icon {
    margin-right: 0.5rem; /* Adds a little breathing room */
}

/* Ensure all icons inside setting rows look consistent */
.setting-row .setting-row-icon .feather {
    width: 20px;
    height: 20px;
}


/*
==============================================
--- UPDATED SECURITY CHECKLIST ---
==============================================
*/

/* Remove the bullet points from the old checklist style if they exist */
.security-checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0; /* Let the setting-row handle the spacing */
}

/* The checklist now uses the standard .setting-row,
   so we don't need many custom styles. This is just a reset. */
.security-checklist .setting-row {
    padding-left: 0;
    padding-right: 0;
}

/* Style for the 'Enable' button in the checklist to make it stand out */
.security-checklist .action a {
    background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
    font-weight: 600;
}


/*
==============================================
--- ACCOUNT MANAGEMENT CARD ---
==============================================
*/

/* Ensure the danger row in the new "Account Management" card
   retains its distinct, attention-grabbing style. */
#account-management-card .setting-row.danger .setting-row-icon {
    background-color: color-mix(in srgb, var(--danger-color) 10%, transparent);
    color: var(--danger-color);
}

#account-management-card .setting-row.danger .action a {
    border-color: var(--danger-color);
    background-color: var(--danger-color);
    color: #fff !important;
}

#account-management-card .setting-row.danger .action a:hover {
    background-color: var(--danger-hover-color);
    border-color: var(--danger-hover-color);
}
/*
================================================================
||
||  Serensip Child Theme - Additions for Security PIN Feature
||
================================================================
*/

/* --- Styles for PIN Input Fields --- */
.pin-input {
    text-align: center;
    letter-spacing: 0.5em; /* Spreads out the dots */
    font-size: 1.5rem; /* Makes the dots larger */
}

/* Prevents the browser's default up/down arrows on number inputs */
.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pin-input[type=number] {
  -moz-appearance: textfield;
}
/* --- NEW: Style for buttons disabled by default to prevent race conditions --- */
.btn--disabled, a.btn--disabled {
    opacity: 0.5;
    pointer-events: none; /* This is the magic property that makes them unclickable */
    cursor: not-allowed;
}
/* --- NEW: STYLES FOR UNIVERSAL NOTIFICATION MODAL --- */

/* Style for the icon container */
#notification-icon-container .feather {
    width: 32px;
    height: 32px;
}

/* Color for the success icon */
#notification-icon-container.success .feather {
    color: var(--success-color);
}

/* Color for the error icon */
#notification-icon-container.error .feather {
    color: var(--danger-color);
}

/* Color for the confirmation icon */
#notification-icon-container.confirm .feather {
    color: var(--accent-color);
}
/*
==============================================
--- 7. ACTIVITY LOG MODAL ---
==============================================
*/

.activity-log-container {
    max-height: 400px; /* Limits height for long logs */
    overflow-y: auto; /* Adds a scrollbar if content overflows */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-align: left;
    margin-bottom: 1.5rem;
}

.activity-log-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-log-container li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

/* Adds a divider line between log entries */
.activity-log-container li + li {
    border-top: 1px solid var(--border-color);
}

.activity-log-container .log-icon {
    flex-shrink: 0;
    color: var(--text-secondary-color);
}

.activity-log-container .log-details {
    flex-grow: 1;
}

.activity-log-container .log-details strong {
    display: block;
    color: var(--text-color);
    font-weight: 600;
}

.activity-log-container .log-details span {
    font-size: 0.9rem;
    color: var(--text-secondary-color);
}

.activity-log-container .loading-state,
.activity-log-container .empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary-color);
}