/**
 * Software Partner Request System Styles
 * Version: 1.1.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --sm-primary: var(--wp--preset--color--primary, var(--global--color-primary, var(--theme-color-primary, #667eea)));
    --sm-secondary: var(--wp--preset--color--secondary, var(--global--color-secondary, var(--theme-color-secondary, #764ba2)));
}

/* ============================================
   Hero Section
   ============================================ */
.sm-page-hero {
    position: relative;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.sm-page-hero-content { 
    max-width: none !important; 
    width: 100% !important;
    margin: 0 !important;
    position: relative;
    background: linear-gradient(135deg, #1a7a7f 0%, #2b5f8f 50%, #3d4ea0 100%);
    border-radius: 0 !important;
    padding: 48px 40px;
    box-shadow: none !important;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}

/* Decorative elements */
.sm-page-hero-content::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.sm-page-hero-content::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    pointer-events: none;
}

.sm-page-hero .page-title {
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 12px 0;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sm-page-hero .page-description {
    font-size: clamp(15px, 1.8vw, 18px);
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.5;
    color: #ffffff;
    position: relative;
    z-index: 1;
    max-width: 800px;
}

/* Documentation link in hero section */
.sm-page-hero-content .sm-doc-link a {
    color: #a78bfa !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.sm-page-hero-content .sm-doc-link a:hover {
    color: #c4b5fd !important;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5) !important;
}

/* Page-level hard reset to avoid theme constraints on this page only */
body.partner-request-page, 
body.partner-request-page #page,
body.partner-request-page .site,
body.partner-request-page .site-content,
body.partner-request-page #content,
body.partner-request-page .container,
body.partner-request-page .wrap,
body.partner-request-page #primary,
body.partner-request-page .content-area,
body.partner-request-page .site-main,
body.partner-request-page #main,
body.partner-request-page .entry-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Full-width layout class used by partner request template */
.sm-full-width-page #primary,
.sm-full-width-page .site-content,
.sm-full-width-page .content-area,
.sm-full-width-page .ast-container,
.sm-full-width-page .ast-row,
.sm-full-width-page .wp-site-blocks,
.sm-full-width-page .ast-col-md-12,
.sm-full-width-page .elementor-container,
.sm-full-width-page [class*="container"] {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sm-full-width-page #primary .primary-sidebar,
.sm-full-width-page #primary .sidebar,
.sm-full-width-page .site-content > aside:not(.sm-sidebar) {
    display: none !important;
}

/* Override Astra container padding for this page only */
body.partner-request-page .ast-container,
body.partner-request-page .ast-container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Edge-to-edge login card inside hero */
.sm-page-hero-content .sm-login-center {
    margin-top: 10px;
    margin-left: 0;
    margin-right: 0;
}

/* ============================================
   Partner Request Form Container
   ============================================ */
.sm-partner-request-form {
    position: relative;
    left: 50%;
    right: 50%;
    margin: 0 -50vw !important;
    width: 100vw !important;
    max-width: none !important;
    background: #f8f9fa;
    padding: 60px 5% 80px;
    box-sizing: border-box;
}

/* Inner form wrapper for better control */
.sm-partner-request-form .sm-form-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Form Structure
   ============================================ */
.sm-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.sm-form-header h2 {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
}

.sm-form-subtitle {
    color: #666;
    font-size: 14px;
}

.sm-partner-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.sm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.sm-form-group {
    display: flex;
    flex-direction: column;
}

.sm-form-group.sm-full-width {
    grid-column: 1 / -1;
}

/* ============================================
   Form Inputs
   ============================================ */
.sm-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.required {
    color: #d63638;
}

.sm-form-group input[type="text"],
.sm-form-group input[type="email"],
.sm-form-group input[type="tel"],
.sm-form-group input[type="url"],
.sm-form-group input[type="number"],
.sm-form-group select {
    padding: 12px 14px;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-shadow: none !important;
    outline: none !important;
}

.sm-form-group input[type="text"]:focus,
.sm-form-group input[type="email"]:focus,
.sm-form-group input[type="tel"]:focus,
.sm-form-group input[type="url"]:focus,
.sm-form-group input[type="number"]:focus,
.sm-form-group select:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* ============================================
   Card-Style Radio Buttons
   ============================================ */
.sm-partner-form .sm-checkbox-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    margin-top: 10px !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    cursor: pointer !important;
    padding: 14px 16px !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border-radius: 50% !important;
    border: 2px solid #cbd5e1 !important;
    margin: 0 !important;
    margin-right: 12px !important;
    margin-left: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    position: static !important;
    opacity: 1 !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label input[type="radio"]:checked {
    border-color: #667eea !important;
    background: #667eea !important;
    box-shadow: inset 0 0 0 3px white !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label .sm-radio-text {
    color: #1f2937 !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    user-select: none !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15) !important;
    border-color: #667eea !important;
}

.sm-partner-form .sm-checkbox-group .sm-checkbox-label input[type="radio"]:focus {
    outline: 2px solid #667eea !important;
    outline-offset: 2px !important;
}

/* ============================================
   Form Footer & Buttons
   ============================================ */
.sm-partner-form .sm-form-footer {
    margin-top: 30px !important;
    text-align: center !important;
}

.sm-partner-form .sm-form-footer .sm-privacy-note {
    font-size: 13px !important;
    color: #666 !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

.sm-partner-form .sm-form-footer .sm-form-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.sm-partner-form .sm-form-footer .sm-form-buttons .sm-submit-btn {
    background: linear-gradient(135deg, var(--sm-primary) 0%, var(--sm-secondary) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 14px 50px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

.sm-partner-form .sm-form-footer .sm-form-buttons .sm-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

.sm-partner-form .sm-form-footer .sm-form-buttons .sm-cancel-btn {
    display: inline-block;
    background: #ffffff;
    color: #666;
    border: 2px solid #c0c0c0;
    padding: 7px 10px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sm-partner-form .sm-form-footer .sm-form-buttons .sm-cancel-btn:hover {
    background: #f9f9f9 !important;
    border-color: #999 !important;
    color: #333 !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* ============================================
   Notices & Status Blocks
   ============================================ */
.sm-login-required,
.sm-already-partner,
.sm-pending-request,
.sm-blocked-request { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 40px 20px;
}

.sm-notice {
    padding: 24px 28px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.sm-notice .dashicons {
    font-size: 44px;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.sm-notice h3 {
    margin: 0 0 6px 0;
    font-size: 22px;
}

.sm-notice p {
    margin: 0;
    color: #333;
}

.sm-notice-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.sm-notice-error {
    background: #f8d7da;
    border-left: 4px solid #d63638;
    color: #721c24;
}

/* ============================================
   Admin Page Styles
   ============================================ */
.wrap .subsubsub a {
    color: #2271b1;
    font-weight: 600;
}

.wrap .subsubsub .count {
    opacity: 0.8;
}

.wrap .subsubsub a.current {
    color: var(--sm-primary);
}

.wrap .wp-list-table.widefat.fixed.striped {
    border-radius: 8px;
    overflow: hidden;
}

.wrap .wp-list-table th,
.wrap .wp-list-table td {
    vertical-align: middle;
    font-size: 13px;
}

.wrap .wp-list-table tbody tr:hover {
    background: #f7faff;
}

.wrap .wp-list-table .button {
    border-radius: 6px;
}

.wrap .wp-list-table .button:hover {
    transform: translateY(-1px);
}

.sm-no-requests {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ============================================
   Modal (Thickbox)
   ============================================ */
#TB_window h2 {
    margin: 0 0 12px;
}

#TB_window .form-table {
    width: 100%;
}

#TB_window .form-table th {
    width: 180px;
    background: #f7f9fc;
    border-radius: 8px;
    padding: 10px 12px;
}

#TB_window .form-table td {
    padding: 10px 12px;
}

#TB_window textarea {
    width: 100%;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
}

#TB_window .button.button-primary {
    background: linear-gradient(135deg, var(--sm-primary), var(--sm-secondary));
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

#TB_window .button.button-secondary {
    background: #eef2ff;
    color: #1a2b6d;
    border: 1px solid #dfe6ff;
}

#TB_window .sm-partner-request-form {
    margin: 0;
    padding: 20px;
}

#TB_window .sm-form-header h2 {
    font-size: 24px;
}

#TB_window .sm-partner-form {
    padding: 20px;
}

/* ============================================
   Status Badges
   ============================================ */
.sm-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.sm-badge-pending {
    background: #fff3cd;
    color: #856404;
}

.sm-badge-approved {
    background: #d4edda;
    color: #155724;
}

.sm-badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .sm-page-hero-content .sm-login-center {
        margin-left: 0;
        margin-right: 0;
    }
    .sm-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .sm-page-hero {
        padding: 20px 15px;
    }
    
    .sm-page-hero-content {
        padding: 32px 24px;
    }
    
    .sm-page-hero .page-title {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .sm-page-hero .page-description {
        font-size: 15px;
    }
    
    .sm-page-hero-content::before,
    .sm-page-hero-content::after {
        display: none;
    }
    
    .sm-partner-request-form {
        padding: 20px;
    }
    
    .sm-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sm-form-header h2 {
        font-size: 24px;
    }
    
    .sm-partner-form {
        padding: 20px;
    }
    
    .sm-notice {
        flex-direction: column;
        text-align: center;
    }
    
    .sm-form-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .sm-submit-btn,
    .sm-cancel-btn {
        width: 100%;
        padding: 14px 30px;
    }
}

/* ============================================
   WordPress Theme Overrides
   ============================================ */
.sm-page-hero,
.sm-page-hero *,
.sm-partner-request-form,
.sm-partner-request-form * {
    box-sizing: border-box;
}

body:has(.partner-request-article),
.partner-request-article {
    overflow-x: hidden;
}

.partner-request-article,
.partner-request-article article,
.partner-request-article .entry-content,
.partner-request-article #primary,
.partner-request-article .site-main,
.partner-request-article #main,
.partner-request-article #content,
.partner-request-article .container,
.partner-request-article .wrap,
.partner-request-article .site-content,
.partner-request-article .content-wrapper,
.partner-request-article .main-content,
.partner-request-article .page-wrapper,
.partner-request-article .site-inner,
.partner-request-article .ast-container,
.partner-request-article .elementor-section,
.partner-request-article .wp-block-group,
.partner-request-article .wp-site-blocks,
.partner-request-article .row,
.partner-request-article [class*="col-"] {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.partner-request-article .flex,
.partner-request-article .d-flex,
.partner-request-article .flex-container,
.partner-request-article .grid,
.partner-request-article .wp-block-columns {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.partner-request-page,
body.full-width-template {
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.partner-request-page #primary,
body.partner-request-page .content-area,
body.partner-request-page .site-main,
body.partner-request-page #main,
body.partner-request-page .entry-content,
body.partner-request-page article,
body.partner-request-page .site-content,
body.partner-request-page #content,
body.partner-request-page .hfeed,
body.partner-request-page main,
body.partner-request-page .container,
body.partner-request-page .wrap,
body.partner-request-page .content-wrapper,
body.partner-request-page #page,
body.partner-request-page .site,
body.full-width-template #primary,
body.full-width-template .content-area,
body.full-width-template .site-main,
body.full-width-template #main,
body.full-width-template .entry-content,
body.full-width-template article,
body.full-width-template .container,
body.full-width-template .wrap,
body.full-width-template .site-content,
body.full-width-template .content-wrapper,
body.full-width-template #page,
body.full-width-template .site {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.partner-request-page #secondary,
body.partner-request-page .sidebar,
body.full-width-template #secondary,
body.full-width-template .sidebar {
    display: none !important;
}

html:has(.partner-request-page) {
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================
   Confirmation Modal
   ============================================ */
.sm-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.sm-confirm-dialog {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.sm-confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.sm-confirm-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.sm-confirm-message {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
}

.sm-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sm-confirm-btn {
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.sm-confirm-yes {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sm-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.sm-confirm-no {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.sm-confirm-no:hover {
    background: #e8e8e8;
}

/* ============================================
   Login Modal
   ============================================ */
.sm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.sm-modal-container {
    max-width: 550px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: auto;
}

.sm-modal-content {
    overflow: visible;
}

#sm-partner-login-modal .sm-login-header {
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}

#sm-partner-login-modal .sm-login-content {
    padding: 20px !important;
}

@media (max-height: 700px) {
    .sm-modal-container {
        max-height: 95vh;
        overflow-y: auto;
    }
}
