/* Somali Presidential Campaign - Custom Styles */

/* Hero Section Enhancements with Somalia-themed backgrounds */
.wp-block-group.has-primary-background-color {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%) !important;
    position: relative;
    overflow: hidden;
}

.wp-block-group.has-primary-background-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='stars' x='0' y='0' width='20' height='20' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='10' cy='10' r='1' fill='white' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23stars)'/%3E%3C/svg%3E") repeat;
    animation: float 20s ease-in-out infinite;
}

/* Somalia flag pattern background */
.wp-block-group.has-accent-background-color {
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 50%, #ff6b35 100%) !important;
    position: relative;
}

.wp-block-group.has-accent-background-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='somali-pattern' x='0' y='0' width='50' height='50' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='25' cy='25' r='2' fill='white' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23somali-pattern)'/%3E%3C/svg%3E") repeat;
}

/* Card backgrounds with subtle patterns */
.wp-block-group.has-white-background-color {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.1);
    position: relative;
}

.wp-block-group.has-white-background-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='subtle-pattern' x='0' y='0' width='30' height='30' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='15' cy='15' r='0.5' fill='%231e3c72' opacity='0.05'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23subtle-pattern)'/%3E%3C/svg%3E") repeat;
    border-radius: inherit;
}

/* Base background with texture */
.wp-block-group.has-base-background-color {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%) !important;
    position: relative;
}

.wp-block-group.has-base-background-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='base-pattern' x='0' y='0' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='20' cy='20' r='1' fill='%231e3c72' opacity='0.03'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23base-pattern)'/%3E%3C/svg%3E") repeat;
}

/* Contrast background */
.wp-block-group.has-contrast-background-color {
    background: linear-gradient(145deg, #e8f4fd 0%, #d1ecf1 100%) !important;
    position: relative;
}

.wp-block-group.has-contrast-background-color::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='contrast-pattern' x='0' y='0' width='25' height='25' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='12.5' cy='12.5' r='0.8' fill='%231e3c72' opacity='0.08'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23contrast-pattern)'/%3E%3C/svg%3E") repeat;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Button Enhancements */
.wp-block-button__link {
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    position: relative;
    overflow: hidden;
}

.wp-block-button__link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.wp-block-button__link:hover::before {
    left: 100%;
}

.wp-block-button__link:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

/* Card Enhancements */
.wp-block-group.has-white-background-color {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-group.has-white-background-color:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Form Enhancements */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
    transition: all 0.3s ease !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    border-color: #1e3c72 !important;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1) !important;
    outline: none !important;
    background: #ffffff !important;
}

/* Amount Button Enhancements */
.amount-btn {
    transition: all 0.3s ease !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    position: relative;
    overflow: hidden;
}

.amount-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 60, 114, 0.1), transparent);
    transition: left 0.3s;
}

.amount-btn:hover::before {
    left: 100%;
}

.amount-btn:hover {
    border-color: #1e3c72 !important;
    background: linear-gradient(145deg, #1e3c72 0%, #2a5298 100%) !important;
    color: white !important;
    transform: translateY(-2px);
}

.amount-btn.active {
    border-color: #1e3c72 !important;
    background: linear-gradient(145deg, #1e3c72 0%, #2a5298 100%) !important;
    color: white !important;
}

/* Checkbox Enhancements */
input[type="checkbox"] {
    accent-color: #1e3c72 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-block-heading {
        font-size: 2rem !important;
    }
    
    .wp-block-columns {
        flex-direction: column !important;
    }
    
    .wp-block-group {
        margin-bottom: 20px !important;
    }
}

/* Custom Colors */
.has-primary-background-color {
    background-color: #1e3c72 !important;
}

.has-accent-background-color {
    background-color: #ff6b35 !important;
}

.has-base-background-color {
    background-color: #f8f9fa !important;
}

.has-contrast-background-color {
    background-color: #e8f4fd !important;
}

/* Typography */
.wp-block-heading {
    font-family: 'Arial', sans-serif !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-block-group {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1e3c72;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6b35;
}

/* Additional visual enhancements */
.wp-block-heading.has-text-align-center {
    position: relative;
}

.wp-block-heading.has-text-align-center::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #1e3c72);
    border-radius: 2px;
}

/* Form styling improvements */
form {
    position: relative;
}

form::before {
    content: "";
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(45deg, rgba(30, 60, 114, 0.05), rgba(255, 107, 53, 0.05));
    border-radius: 25px;
    z-index: -1;
}

/* Header Layout Fixes */
.campaign-header .header-content {
    min-height: 80px;
}

.campaign-header nav ul {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.campaign-header nav ul::-webkit-scrollbar {
    display: none;
}

/* Ensure proper spacing */
.campaign-header .site-logo,
.campaign-header .main-navigation,
.campaign-header .header-cta {
    min-width: fit-content;
}

/* Prevent text wrapping in navigation */
.campaign-header nav a {
    display: inline-block;
    vertical-align: middle;
}

/* Top bar improvements */
.campaign-top-bar {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.campaign-top-bar::-webkit-scrollbar {
    display: none;
}

.campaign-top-bar .container {
    min-width: max-content;
}

/* Hide page titles that appear on top left */
.entry-header,
.ast-single-entry-banner,
.page-header,
.page-title,
.entry-title {
    display: none !important;
}

/* Hide breadcrumbs if any */
.ast-breadcrumbs {
    display: none !important;
}

/* Donation Form Styling */
.donation-form-container input[type="text"],
.donation-form-container input[type="email"],
.donation-form-container input[type="tel"],
.donation-form-container input[type="number"],
.donation-form-container textarea {
    background: white !important;
    color: #1e3c72 !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.donation-form-container input[type="text"]:focus,
.donation-form-container input[type="email"]:focus,
.donation-form-container input[type="tel"]:focus,
.donation-form-container input[type="number"]:focus,
.donation-form-container textarea:focus {
    border-color: #ff6b35 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
}

.donation-form-container input[type="text"]::placeholder,
.donation-form-container input[type="email"]::placeholder,
.donation-form-container input[type="tel"]::placeholder,
.donation-form-container input[type="number"]::placeholder,
.donation-form-container textarea::placeholder {
    color: #999 !important;
}

/* Amount button styling */
.amount-btn {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border: 2px solid #e1e5e9 !important;
    background: white !important;
    color: #1e3c72 !important;
    padding: 15px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

.amount-btn:hover {
    border-color: #ff6b35 !important;
    background-color: #f8f9fa !important;
    color: #d8d8d8 !important;
}

.amount-btn.selected {
    border-color: #ff6b35 !important;
    background-color: #ff6b35 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3) !important;
}

/* Payment option styling */
.payment-option {
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 2px solid #e1e5e9 !important;
    background: white !important;
    padding: 15px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.payment-option:hover {
    border-color: #ff6b35 !important;
    background-color: #f8f9fa !important;
}

.payment-option.selected {
    border-color: #ff6b35 !important;
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2) !important;
}

.payment-option input[type="radio"] {
    margin-right: 10px !important;
    cursor: pointer !important;
}

/* RTL Support for Arabic */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

body[dir="rtl"] .campaign-header .header-content {
    flex-direction: row-reverse;
}

body[dir="rtl"] .campaign-header nav ul {
    flex-direction: row-reverse;
}

body[dir="rtl"] .campaign-header .site-logo {
    order: 3;
}

body[dir="rtl"] .campaign-header .main-navigation {
    order: 2;
}

body[dir="rtl"] .campaign-header .header-cta {
    order: 1;
}

body[dir="rtl"] .campaign-top-bar .container {
    flex-direction: row-reverse;
}

body[dir="rtl"] .campaign-top-bar .top-bar-right {
    flex-direction: row-reverse;
}

body[dir="rtl"] .campaign-language-switcher {
    flex-direction: row-reverse;
}

/* RTL Footer */
body[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

body[dir="rtl"] .footer-section {
    text-align: right;
}

body[dir="rtl"] .social-links {
    flex-direction: row-reverse;
}

body[dir="rtl"] .footer-bottom .container > div {
    flex-direction: row-reverse;
}

body[dir="rtl"] .legal-links {
    flex-direction: row-reverse;
}

/* RTL Form Elements */
body[dir="rtl"] input[type="text"],
body[dir="rtl"] input[type="email"],
body[dir="rtl"] input[type="tel"],
body[dir="rtl"] textarea,
body[dir="rtl"] select {
    text-align: right;
}

body[dir="rtl"] .form-group label {
    text-align: right;
}

/* RTL Grid Layouts */
body[dir="rtl"] .grid-2 {
    direction: rtl;
}

body[dir="rtl"] .grid-3 {
    direction: rtl;
}

/* RTL Cards */
body[dir="rtl"] .card {
    text-align: right;
}

body[dir="rtl"] .card h3 {
    text-align: right;
}

body[dir="rtl"] .card p {
    text-align: right;
}

/* RTL Buttons */
body[dir="rtl"] .btn {
    text-align: center;
}

/* RTL Navigation */
body[dir="rtl"] .main-navigation ul li {
    margin-left: 0;
    margin-right: 8px;
}

body[dir="rtl"] .main-navigation ul li:last-child {
    margin-right: 0;
}

/* RTL Language Switcher */
body[dir="rtl"] .campaign-language-switcher a {
    margin-left: 0;
    margin-right: 3px;
}

body[dir="rtl"] .campaign-language-switcher a:last-child {
    margin-right: 0;
}

/* RTL Social Media Icons */
body[dir="rtl"] .social-links a {
    margin-left: 0;
    margin-right: 15px;
}

body[dir="rtl"] .social-links a:last-child {
    margin-right: 0;
}

/* RTL Content Areas */
body[dir="rtl"] .content-section {
    text-align: right;
}

body[dir="rtl"] .content-section h2 {
    text-align: right;
}

body[dir="rtl"] .content-section p {
    text-align: right;
}

/* RTL Lists */
body[dir="rtl"] ul {
    padding-right: 20px;
    padding-left: 0;
}

body[dir="rtl"] li {
    text-align: right;
}

/* RTL Tables */
body[dir="rtl"] table {
    direction: rtl;
}

body[dir="rtl"] th,
body[dir="rtl"] td {
    text-align: right;
}

/* RTL Form Layouts */
body[dir="rtl"] .form-row {
    flex-direction: row-reverse;
}

body[dir="rtl"] .form-group {
    text-align: right;
}

/* RTL Modal/Dialog */
body[dir="rtl"] .modal {
    text-align: right;
}

body[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

body[dir="rtl"] .modal-body {
    text-align: right;
}

body[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

/* RTL Payment Options */
body[dir="rtl"] .payment-option {
    flex-direction: row-reverse;
}

body[dir="rtl"] .payment-option input[type="radio"] {
    margin-right: 0 !important;
    margin-left: 10px !important;
}