/* ==========================================================================
   CWAM Foundation Voting System - Frontend Styles
   https://cwamfoundation.org

   Color Palette:
   - Primary Navy:    #0d1b3e
   - Secondary Green: #1a8a5c
   - Accent Gold:     #d4a843
   - Light BG:        #f5f7fa
   - White:           #ffffff
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --cwam-navy: #0d1b3e;
    --cwam-navy-light: #142952;
    --cwam-navy-dark: #080f24;
    --cwam-green: #1a8a5c;
    --cwam-green-light: #22a96f;
    --cwam-green-dark: #14704a;
    --cwam-gold: #d4a843;
    --cwam-gold-light: #e0bb5f;
    --cwam-light-bg: #f5f7fa;
    --cwam-white: #ffffff;
    --cwam-text-primary: #1a1a2e;
    --cwam-text-secondary: #555e6e;
    --cwam-text-muted: #8b95a5;
    --cwam-border: #e2e8f0;
    --cwam-shadow-sm: 0 1px 3px rgba(13, 27, 62, 0.06), 0 1px 2px rgba(13, 27, 62, 0.04);
    --cwam-shadow-md: 0 4px 16px rgba(13, 27, 62, 0.08), 0 2px 4px rgba(13, 27, 62, 0.04);
    --cwam-shadow-lg: 0 12px 40px rgba(13, 27, 62, 0.12), 0 4px 12px rgba(13, 27, 62, 0.06);
    --cwam-shadow-xl: 0 20px 60px rgba(13, 27, 62, 0.16), 0 8px 20px rgba(13, 27, 62, 0.08);
    --cwam-radius-sm: 8px;
    --cwam-radius-md: 12px;
    --cwam-radius-lg: 16px;
    --cwam-radius-xl: 20px;
    --cwam-radius-pill: 50px;
    --cwam-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Site fonts: Poppins for titles/headings, Manrope for subtitles & body content */
    --cwam-font-title: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cwam-font-body: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cwam-font: var(--cwam-font-body);
}

/* --------------------------------------------------------------------------
   1. Base Container - .cwam-voting
   -------------------------------------------------------------------------- */
.cwam-voting {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: var(--cwam-font);
    color: var(--cwam-text-primary);
    line-height: 1.6;
    background: var(--cwam-light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cwam-voting *,
.cwam-voting *::before,
.cwam-voting *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Hero Banner - .cwam-hero
   -------------------------------------------------------------------------- */
.cwam-hero {
    background: var(--cwam-navy);
    position: relative;
    overflow: hidden;
    padding: 60px 24px;
    text-align: center;
}

.cwam-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cwam-green);
}

.cwam-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cwam-hero h1 {
    color: var(--cwam-white);
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.cwam-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 17px;
    margin: 0;
    line-height: 1.6;
}

.cwam-hero p strong {
    color: var(--cwam-gold);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. Category Navigation - .cwam-category-nav / .cwam-tab
   -------------------------------------------------------------------------- */
.cwam-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 28px 24px;
    background: var(--cwam-white);
    border-bottom: 1px solid var(--cwam-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--cwam-shadow-sm);
}

.cwam-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 2px solid var(--cwam-border);
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--cwam-text-secondary);
    cursor: pointer;
    transition: all var(--cwam-transition);
    white-space: nowrap;
    font-family: var(--cwam-font);
    line-height: 1.4;
}

.cwam-tab:hover {
    border-color: var(--cwam-green);
    color: var(--cwam-green);
    background: rgba(26, 138, 92, 0.04);
}

.cwam-tab-active {
    background: var(--cwam-navy);
    color: var(--cwam-white);
    border-color: var(--cwam-navy);
}

.cwam-tab-active:hover {
    background: var(--cwam-navy-light);
    color: var(--cwam-white);
    border-color: var(--cwam-navy-light);
}

.cwam-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    background: rgba(13, 27, 62, 0.08);
    color: var(--cwam-text-secondary);
}

.cwam-tab-active .cwam-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--cwam-white);
}

/* --------------------------------------------------------------------------
   4. Category Panels - .cwam-category-panel / .cwam-panel-active
   -------------------------------------------------------------------------- */
.cwam-category-panel {
    display: none;
}

.cwam-panel-active {
    display: block;
    animation: cwamFadeIn 0.4s ease;
}

@keyframes cwamFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   5. Category Section - .cwam-category-section / .cwam-section-header
   -------------------------------------------------------------------------- */
.cwam-category-section {
    padding: 40px 32px;
}

.cwam-category-section + .cwam-category-section {
    border-top: 1px solid var(--cwam-border);
}

.cwam-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.cwam-section-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.cwam-section-header p {
    font-size: 15px;
    color: var(--cwam-text-muted);
    margin: 0;
    font-style: italic;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   6. Candidates Grid - .cwam-candidates-grid
   -------------------------------------------------------------------------- */
.cwam-candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

/* --------------------------------------------------------------------------
   7. Candidate Card - .cwam-candidate-card
   -------------------------------------------------------------------------- */
.cwam-candidate-card {
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-lg);
    box-shadow: var(--cwam-shadow-md);
    overflow: hidden;
    transition: transform var(--cwam-transition), box-shadow var(--cwam-transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.cwam-candidate-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--cwam-shadow-xl);
}

/* Card Link */
.cwam-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cwam-card-link:hover,
.cwam-card-link:focus,
.cwam-card-link:visited {
    text-decoration: none;
    color: inherit;
}

/* Card Image */
.cwam-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--cwam-light-bg);
}

.cwam-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cwam-candidate-card:hover .cwam-card-image img {
    transform: scale(1.05);
}

/* Card Image Overlay */
.cwam-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 27, 62, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 24px;
    opacity: 0;
    transition: opacity var(--cwam-transition);
}

.cwam-candidate-card:hover .cwam-card-overlay {
    opacity: 1;
}

.cwam-card-overlay span {
    color: var(--cwam-white);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 24px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--cwam-radius-pill);
    backdrop-filter: blur(4px);
    transition: all var(--cwam-transition);
}

.cwam-candidate-card:hover .cwam-card-overlay span {
    border-color: var(--cwam-white);
    background: rgba(255, 255, 255, 0.1);
}

/* Card Placeholder */
.cwam-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cwam-navy);
}

.cwam-card-placeholder span {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 800;
    text-transform: uppercase;
}

/* Card Body */
.cwam-card-body {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cwam-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--cwam-navy);
    margin: 0 0 6px;
    line-height: 1.3;
}

.cwam-card-desc {
    font-size: 13px;
    color: var(--cwam-text-muted);
    margin: 0 0 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cwam-card-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--cwam-text-secondary);
    margin-bottom: 14px;
}

.cwam-card-location svg {
    flex-shrink: 0;
    color: var(--cwam-text-muted);
}

/* Card Votes */
.cwam-card-votes {
    margin-top: auto;
    padding-top: 12px;
}

.cwam-votes-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(26, 138, 92, 0.08);
    border-radius: var(--cwam-radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--cwam-green);
}

.cwam-votes-badge svg {
    color: var(--cwam-green);
    flex-shrink: 0;
}

.cwam-votes-badge .cwam-count {
    font-size: 18px;
    font-weight: 800;
    color: var(--cwam-green-dark);
}

/* Card Footer */
.cwam-card-footer {
    padding: 0 22px 22px;
}

/* --------------------------------------------------------------------------
   8. Buttons - .cwam-btn
   -------------------------------------------------------------------------- */
.cwam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--cwam-radius-pill);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--cwam-transition);
    font-family: var(--cwam-font);
    line-height: 1.4;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.cwam-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.cwam-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Primary Button - Navy */
.cwam-btn-primary {
    background: var(--cwam-navy);
    color: var(--cwam-white);
}

.cwam-btn-primary:hover {
    background: var(--cwam-navy-light);
    color: var(--cwam-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 27, 62, 0.3);
}

.cwam-btn-primary:focus {
    background: var(--cwam-navy-light);
    color: var(--cwam-white);
    box-shadow: 0 0 0 3px rgba(13, 27, 62, 0.2);
    outline: none;
}

.cwam-btn-primary:active {
    background: var(--cwam-navy-dark);
    color: var(--cwam-white);
    transform: translateY(0);
    box-shadow: none;
    outline: none;
}

.cwam-btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Vote Button - Green */
.cwam-btn-vote {
    background: var(--cwam-green);
    color: var(--cwam-white);
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    border: none;
    border-radius: var(--cwam-radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--cwam-transition);
    font-family: var(--cwam-font);
}

.cwam-btn-vote:hover {
    background: var(--cwam-green-light);
    color: var(--cwam-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 138, 92, 0.35);
}

.cwam-btn-vote:focus {
    background: var(--cwam-green-light);
    color: var(--cwam-white);
    box-shadow: 0 0 0 3px rgba(26, 138, 92, 0.2);
    outline: none;
}

.cwam-btn-vote:active {
    background: var(--cwam-green-dark);
    color: var(--cwam-white);
    transform: translateY(0);
    box-shadow: none;
    outline: none;
}

/* Full Width */
.cwam-btn-full {
    width: 100%;
}

/* --------------------------------------------------------------------------
   9. Modal - .cwam-modal
   -------------------------------------------------------------------------- */
.cwam-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cwam-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 62, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cwam-modal-content {
    position: relative;
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-xl);
    padding: 0;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow: var(--cwam-shadow-xl);
    animation: cwamModalIn 0.3s ease;
}

.cwam-modal-content::before {
    display: none;
}

@keyframes cwamModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Close */
.cwam-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cwam-light-bg);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    color: var(--cwam-text-muted);
    cursor: pointer;
    transition: all var(--cwam-transition);
    line-height: 1;
    z-index: 2;
}

.cwam-modal-close:hover {
    background: var(--cwam-border);
    color: var(--cwam-text-primary);
}

/* Modal Badge */
.cwam-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(26, 138, 92, 0.08);
    color: var(--cwam-green);
    border-radius: var(--cwam-radius-pill);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.cwam-modal-badge svg {
    flex-shrink: 0;
}

/* Modal Header */
.cwam-modal-header {
    margin-bottom: 24px;
}

.cwam-modal-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 8px;
    padding-right: 30px;
}

.cwam-modal-header p {
    font-size: 14px;
    color: var(--cwam-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Modal Steps */
.cwam-modal-step {
    text-align: left;
    padding: 32px 36px 36px;
}

.cwam-step-centered {
    text-align: center;
}

.cwam-modal-step h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 8px;
}

.cwam-step-centered h3 {
    text-align: center;
}

.cwam-modal-step > p {
    color: var(--cwam-text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.6;
}

.cwam-step-centered > p {
    text-align: center;
}

/* Form Groups */
.cwam-form-group {
    margin-bottom: 18px;
}

.cwam-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--cwam-text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cwam-input-wrap {
    position: relative;
}

.cwam-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cwam-text-muted);
    pointer-events: none;
    transition: color var(--cwam-transition);
}

.cwam-input-wrap input:focus ~ .cwam-input-icon,
.cwam-input-wrap:focus-within .cwam-input-icon {
    color: var(--cwam-navy);
}

.cwam-voting .cwam-form-group .cwam-input-wrap input {
    width: 100%;
    padding: 12px 16px 12px 44px !important;
    border: 2px solid var(--cwam-border) !important;
    border-radius: var(--cwam-radius-sm) !important;
    font-size: 15px;
    font-family: var(--cwam-font);
    color: var(--cwam-text-primary);
    transition: border-color var(--cwam-transition), box-shadow var(--cwam-transition);
    box-sizing: border-box;
    background: var(--cwam-white);
}

.cwam-voting .cwam-form-group .cwam-input-wrap input::placeholder {
    color: var(--cwam-text-muted);
}

.cwam-voting .cwam-form-group .cwam-input-wrap input:focus {
    border-color: var(--cwam-green) !important;
    box-shadow: 0 0 0 3px rgba(26, 138, 92, 0.1) !important;
    outline: none;
}

.cwam-form-group small {
    display: block;
    color: var(--cwam-text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Vote Package Selector */
.cwam-vote-package {
    margin-bottom: 18px;
}

.cwam-vote-package label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--cwam-text-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cwam-vote-package select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--cwam-border);
    border-radius: var(--cwam-radius-sm);
    font-size: 15px;
    font-family: var(--cwam-font);
    color: var(--cwam-text-primary);
    background: var(--cwam-white);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555e6e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--cwam-transition), box-shadow var(--cwam-transition);
    box-sizing: border-box;
}

.cwam-vote-package select:focus {
    border-color: var(--cwam-navy);
    box-shadow: 0 0 0 3px rgba(13, 27, 62, 0.1);
    outline: none;
}

.cwam-custom-votes {
    margin-top: 10px;
    display: none;
}

.cwam-custom-votes input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--cwam-border);
    border-radius: var(--cwam-radius-sm);
    font-size: 15px;
    font-family: var(--cwam-font);
    color: var(--cwam-text-primary);
    background: var(--cwam-white);
    transition: border-color var(--cwam-transition), box-shadow var(--cwam-transition);
    box-sizing: border-box;
}

.cwam-custom-votes input:focus {
    border-color: var(--cwam-navy);
    box-shadow: 0 0 0 3px rgba(13, 27, 62, 0.1);
    outline: none;
}

.cwam-custom-votes small {
    display: block;
    color: var(--cwam-text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Modal Amount Display */
.cwam-modal-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(13, 27, 62, 0.03);
    border: 1px solid rgba(13, 27, 62, 0.1);
    border-radius: var(--cwam-radius-sm);
    margin-bottom: 20px;
}

.cwam-modal-amount span {
    font-size: 13px;
    color: var(--cwam-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cwam-modal-amount strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--cwam-navy);
}

/* Modal Submit Button - Navy */
.cwam-modal-step .cwam-btn-submit {
    background: var(--cwam-navy);
    color: var(--cwam-white);
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    border: none;
    border-radius: var(--cwam-radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--cwam-transition);
    font-family: var(--cwam-font);
}

.cwam-modal-step .cwam-btn-submit:hover {
    background: var(--cwam-navy-light);
    color: var(--cwam-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 27, 62, 0.3);
}

.cwam-modal-step .cwam-btn-submit:focus {
    background: var(--cwam-navy-light);
    color: var(--cwam-white);
    box-shadow: 0 0 0 3px rgba(13, 27, 62, 0.2);
    outline: none;
}

.cwam-modal-step .cwam-btn-submit:active {
    background: var(--cwam-navy-dark);
    color: var(--cwam-white);
    transform: translateY(0);
    box-shadow: none;
    outline: none;
}

.cwam-modal-step .cwam-btn-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secure Badge */
.cwam-modal-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--cwam-text-muted);
    font-weight: 500;
}

.cwam-modal-secure svg {
    flex-shrink: 0;
    color: var(--cwam-green);
}

/* Processing Phone Icon */
.cwam-processing-phone {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cwam-green);
}

.cwam-phone-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border: 2px solid var(--cwam-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: cwamPulse 2s ease-out infinite;
}

@keyframes cwamPulse {
    0% {
        width: 80px;
        height: 80px;
        opacity: 0.5;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

/* Success Icon */
.cwam-icon-success {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(26, 138, 92, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--cwam-green);
    animation: cwamSuccessIn 0.5s ease;
}

@keyframes cwamSuccessIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error Icon */
.cwam-icon-error {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #dc2626;
}

/* Processing Bar */
.cwam-processing-bar {
    width: 100%;
    height: 6px;
    background: var(--cwam-border);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}

.cwam-processing-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--cwam-green);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.cwam-processing-hint {
    color: var(--cwam-text-muted);
    font-size: 13px;
    text-align: center;
    margin: 0;
}

/* Receipt Box */
.cwam-receipt-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(26, 138, 92, 0.04);
    border: 1px dashed rgba(26, 138, 92, 0.25);
    border-radius: var(--cwam-radius-sm);
    margin: 20px 0;
}

.cwam-receipt-box span {
    font-size: 13px;
    color: var(--cwam-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cwam-receipt-box strong {
    font-size: 17px;
    font-weight: 800;
    color: var(--cwam-green);
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   10. Candidate Detail Page - .cwam-detail-view
   -------------------------------------------------------------------------- */
.cwam-detail-view {
    background: var(--cwam-light-bg);
    min-height: 100vh;
    font-family: var(--cwam-font-body);
    color: var(--cwam-text-primary);
}

/* Breadcrumb */
.cwam-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 14px;
    color: var(--cwam-text-muted);
    background: var(--cwam-white);
    border-bottom: 1px solid var(--cwam-border);
    flex-wrap: wrap;
}

.cwam-breadcrumb a {
    color: var(--cwam-green);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--cwam-transition);
}

.cwam-breadcrumb a:hover {
    color: var(--cwam-green-dark);
}

.cwam-breadcrumb svg {
    color: var(--cwam-text-muted);
    flex-shrink: 0;
    opacity: 0.5;
}

.cwam-breadcrumb span {
    color: var(--cwam-text-primary);
    font-weight: 600;
}

/* Detail Layout - 2 Columns */
.cwam-detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    padding: 32px;
    align-items: start;
}

/* Detail Main Content */
.cwam-detail-main {
    min-width: 0;
}

/* Detail Hero - Horizontal Layout */
.cwam-detail-hero {
    display: flex;
    gap: 36px;
    align-items: center;
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-lg);
    padding: 36px;
    box-shadow: var(--cwam-shadow-md);
    margin-bottom: 28px;
}

/* Detail Photo */
.cwam-detail-photo {
    flex-shrink: 0;
    width: 240px;
}

.cwam-detail-photo img {
    width: 240px !important;
    height: 300px !important;
    border-radius: var(--cwam-radius-lg);
    object-fit: cover;
    display: block;
    box-shadow: var(--cwam-shadow-md);
}

.cwam-detail-placeholder {
    width: 240px;
    height: 300px;
    border-radius: var(--cwam-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cwam-navy);
    box-shadow: var(--cwam-shadow-md);
}

.cwam-detail-placeholder span {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 800;
    text-transform: uppercase;
}

/* Detail Hero Info */
.cwam-detail-hero-info {
    flex: 1;
    min-width: 0;
}

.cwam-detail-hero-info h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.cwam-detail-tagline {
    font-size: 16px;
    color: var(--cwam-text-secondary);
    margin: 0 0 14px;
    line-height: 1.5;
}

.cwam-detail-category {
    display: inline-block;
    padding: 4px 14px;
    background: var(--cwam-gold);
    color: var(--cwam-navy);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--cwam-radius-pill);
    margin-bottom: 12px;
}

.cwam-detail-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--cwam-text-secondary);
    margin-bottom: 18px;
}

.cwam-detail-meta svg {
    color: var(--cwam-text-muted);
    flex-shrink: 0;
}

/* Detail Votes Display */
.cwam-detail-votes-display {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.cwam-detail-vote-number {
    font-size: 14px;
    color: var(--cwam-green);
}

.cwam-detail-vote-number .cwam-count {
    font-size: 40px;
    font-weight: 900;
    color: var(--cwam-green-dark);
    line-height: 1;
}

.cwam-detail-vote-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cwam-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Detail Sections */
.cwam-detail-section {
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-lg);
    padding: 32px;
    box-shadow: var(--cwam-shadow-md);
    margin-bottom: 28px;
}

.cwam-detail-section h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--cwam-light-bg);
    position: relative;
}

.cwam-detail-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--cwam-green);
}

/* Detail Bio */
.cwam-detail-bio {
    font-size: 15px;
    color: var(--cwam-text-secondary);
    line-height: 1.8;
}

.cwam-detail-bio p {
    margin: 0 0 16px;
}

.cwam-detail-bio p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   11. Gallery - .cwam-gallery
   -------------------------------------------------------------------------- */
.cwam-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.cwam-gallery-thumb {
    position: relative;
    border-radius: var(--cwam-radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.cwam-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--cwam-radius-md);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cwam-gallery-thumb:hover img {
    transform: scale(1.08);
}

.cwam-gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(13, 27, 62, 0);
    border-radius: var(--cwam-radius-md);
    transition: background var(--cwam-transition);
}

.cwam-gallery-thumb:hover::after {
    background: rgba(13, 27, 62, 0.15);
}

/* --------------------------------------------------------------------------
   12. Lightbox - .cwam-lightbox
   -------------------------------------------------------------------------- */
.cwam-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cwam-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 15, 36, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cwam-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 28px;
    color: var(--cwam-white);
    cursor: pointer;
    z-index: 2;
    transition: all var(--cwam-transition);
}

.cwam-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cwam-lightbox-prev,
.cwam-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 28px;
    color: var(--cwam-white);
    cursor: pointer;
    z-index: 2;
    transition: all var(--cwam-transition);
}

.cwam-lightbox-prev {
    left: 20px;
}

.cwam-lightbox-next {
    right: 20px;
}

.cwam-lightbox-prev:hover,
.cwam-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.cwam-lightbox-img-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 85vh;
    padding: 16px;
}

.cwam-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--cwam-radius-sm);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.cwam-lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   13. Sidebar - .cwam-detail-sidebar
   -------------------------------------------------------------------------- */
.cwam-detail-sidebar {
    position: sticky;
    top: 100px;
}

/* Sidebar Card */
.cwam-sidebar-card {
    background: var(--cwam-white);
    border-radius: var(--cwam-radius-lg);
    padding: 28px;
    box-shadow: var(--cwam-shadow-md);
    margin-bottom: 24px;
}

.cwam-sidebar-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--cwam-navy);
    margin: 0 0 20px;
}

/* Vote Card - Highlighted */
.cwam-vote-card {
    border: 2px solid var(--cwam-border);
    position: relative;
    overflow: hidden;
}

.cwam-vote-card::before {
    display: none;
}

.cwam-vote-card .cwam-btn-primary {
    background: var(--cwam-navy);
    margin-top: 8px;
}

.cwam-vote-card .cwam-btn-primary:hover {
    background: var(--cwam-navy-light);
}

/* Sidebar Votes */
.cwam-sidebar-votes {
    text-align: center;
    padding: 20px 0;
}

.cwam-big-vote-count {
    margin-bottom: 4px;
}

.cwam-big-vote-count .cwam-count {
    font-size: 56px;
    font-weight: 900;
    color: var(--cwam-green-dark);
    line-height: 1;
}

.cwam-sidebar-votes p {
    font-size: 14px;
    font-weight: 600;
    color: var(--cwam-text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cwam-vote-hint {
    text-align: center;
    font-size: 12px;
    color: var(--cwam-text-muted);
    margin: 12px 0 0;
}

/* Recent Voters */
.cwam-recent-voters {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cwam-recent-voters li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cwam-light-bg);
}

.cwam-recent-voters li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cwam-recent-voters li:first-child {
    padding-top: 0;
}

.cwam-voter-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--cwam-white);
    background: var(--cwam-green);
    flex-shrink: 0;
    text-transform: uppercase;
}

.cwam-recent-voters li:nth-child(2n) .cwam-voter-avatar {
    background: var(--cwam-navy);
}

.cwam-recent-voters li:nth-child(3n) .cwam-voter-avatar {
    background: var(--cwam-gold);
    color: var(--cwam-navy);
}

.cwam-voter-info {
    flex: 1;
    min-width: 0;
}

.cwam-voter-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cwam-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwam-voter-info small {
    font-size: 12px;
    color: var(--cwam-text-muted);
}

/* Related Candidates */
.cwam-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cwam-related-list li {
    border-bottom: 1px solid var(--cwam-light-bg);
}

.cwam-related-list li:last-child {
    border-bottom: none;
}

.cwam-related-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
    transition: opacity var(--cwam-transition);
}

.cwam-related-list a:hover {
    opacity: 0.8;
}

.cwam-related-photo {
    width: 44px;
    height: 44px;
    border-radius: var(--cwam-radius-sm);
    overflow: hidden;
    background: var(--cwam-light-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cwam-related-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cwam-related-photo span {
    font-size: 16px;
    font-weight: 700;
    color: var(--cwam-text-muted);
    text-transform: uppercase;
}

.cwam-related-info {
    flex: 1;
    min-width: 0;
}

.cwam-related-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cwam-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwam-related-info small {
    font-size: 12px;
    color: var(--cwam-green);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   14. Responsive - Tablet (768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .cwam-hero {
        padding: 40px 20px;
    }

    .cwam-hero h1 {
        font-size: 26px;
    }

    .cwam-hero p {
        font-size: 15px;
    }

    .cwam-category-nav {
        gap: 8px;
        padding: 16px 16px;
    }

    .cwam-tab {
        padding: 8px 18px;
        font-size: 13px;
    }

    .cwam-category-section {
        padding: 28px 20px;
    }

    .cwam-section-header h2 {
        font-size: 22px;
    }

    .cwam-candidates-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .cwam-card-image {
        height: 240px;
    }

    /* Detail Page - Single Column */
    .cwam-detail-layout {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }

    .cwam-detail-hero {
        flex-direction: column;
        text-align: center;
        padding: 28px;
        gap: 24px;
    }

    .cwam-detail-photo img {
        width: 200px;
        height: 200px;
    }

    .cwam-detail-placeholder {
        width: 200px;
        height: 200px;
    }

    .cwam-detail-placeholder span {
        font-size: 56px;
    }

    .cwam-detail-hero-info h1 {
        font-size: 26px;
    }

    .cwam-detail-meta {
        justify-content: center;
    }

    .cwam-detail-votes-display {
        justify-content: center;
    }

    .cwam-detail-section {
        padding: 24px;
    }

    .cwam-detail-sidebar {
        position: static;
    }

    .cwam-breadcrumb {
        padding: 12px 20px;
    }

    .cwam-modal-content {
        padding: 28px;
        margin: 0;
    }

    .cwam-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    /* Lightbox */
    .cwam-lightbox-prev {
        left: 8px;
    }

    .cwam-lightbox-next {
        right: 8px;
    }

    .cwam-lightbox-prev,
    .cwam-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .cwam-lightbox-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}

/* --------------------------------------------------------------------------
   15. Responsive - Mobile (480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .cwam-hero {
        padding: 32px 16px;
    }

    .cwam-hero h1 {
        font-size: 22px;
    }

    .cwam-hero p {
        font-size: 14px;
    }

    .cwam-category-nav {
        gap: 6px;
        padding: 12px;
    }

    .cwam-tab {
        padding: 7px 14px;
        font-size: 12px;
    }

    .cwam-tab-count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .cwam-category-section {
        padding: 20px 14px;
    }

    .cwam-section-header h2 {
        font-size: 20px;
    }

    .cwam-candidates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cwam-card-image {
        height: 220px;
    }

    .cwam-card-body {
        padding: 16px;
    }

    .cwam-card-footer {
        padding: 0 16px 16px;
    }

    .cwam-detail-layout {
        padding: 14px;
        gap: 16px;
    }

    .cwam-detail-hero {
        padding: 20px;
    }

    .cwam-detail-photo img {
        width: 160px;
        height: 160px;
    }

    .cwam-detail-placeholder {
        width: 160px;
        height: 160px;
    }

    .cwam-detail-placeholder span {
        font-size: 44px;
    }

    .cwam-detail-hero-info h1 {
        font-size: 22px;
    }

    .cwam-detail-vote-number .cwam-count {
        font-size: 32px;
    }

    .cwam-detail-section {
        padding: 20px;
    }

    .cwam-detail-section h2 {
        font-size: 18px;
    }

    .cwam-sidebar-card {
        padding: 20px;
    }

    .cwam-big-vote-count .cwam-count {
        font-size: 44px;
    }

    .cwam-modal-content {
        padding: 24px 20px;
        border-radius: var(--cwam-radius-lg);
    }

    .cwam-modal-header h3 {
        font-size: 18px;
    }

    .cwam-breadcrumb {
        padding: 10px 14px;
        font-size: 13px;
    }

    .cwam-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

/* --------------------------------------------------------------------------
   16. Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .cwam-hero,
    .cwam-category-nav,
    .cwam-card-footer,
    .cwam-modal,
    .cwam-lightbox,
    .cwam-btn-vote,
    .cwam-vote-card {
        display: none !important;
    }

    .cwam-voting {
        background: none;
    }

    .cwam-candidate-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .cwam-detail-layout {
        grid-template-columns: 1fr;
    }

    .cwam-sidebar-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* --------------------------------------------------------------------------
   17. Accessibility & Focus States
   -------------------------------------------------------------------------- */
.cwam-tab:focus-visible,
.cwam-btn:focus-visible,
.cwam-btn-vote:focus-visible,
.cwam-modal-close:focus-visible,
.cwam-lightbox-close:focus-visible,
.cwam-lightbox-prev:focus-visible,
.cwam-lightbox-next:focus-visible {
    outline: 3px solid var(--cwam-gold);
    outline-offset: 2px;
}

.cwam-card-link:focus-visible {
    outline: 3px solid var(--cwam-gold);
    outline-offset: 2px;
    border-radius: var(--cwam-radius-lg);
}

.cwam-voting .cwam-form-group .cwam-input-wrap input:focus-visible {
    outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .cwam-voting *,
    .cwam-voting *::before,
    .cwam-voting *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cwam-candidate-card:hover {
        transform: none;
    }

    .cwam-gallery-thumb:hover img {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   18. WordPress Theme Overrides
   -------------------------------------------------------------------------- */
.cwam-voting h1,
.cwam-voting h2,
.cwam-voting h3,
.cwam-hero h1,
.cwam-section-header h2,
.cwam-card-name,
.cwam-modal-header h3,
.cwam-modal-step h3,
.cwam-detail-hero-info h1,
.cwam-detail-section h2,
.cwam-sidebar-card h3 {
    font-family: var(--cwam-font-title);
}

.cwam-voting a {
    text-decoration: none;
}

.cwam-voting ul {
    list-style: none;
}

.cwam-voting img {
    max-width: 100%;
    height: auto;
}

.cwam-voting button {
    font-family: var(--cwam-font);
}
