/**
 * Eduzah Courses - Frontend Styles
 * Matches the design from the reference screenshot
 * HIGH SPECIFICITY VERSION - Override Elementor
 */

/* ================================
   MAXIMUM SPECIFICITY OVERRIDES
   ================================ */

/* Force remove Elementor section/container padding */
html body .elementor .elementor-section:has(.eduzah-courses-wrapper),
html body .elementor .elementor-container:has(.eduzah-courses-wrapper),
html body .elementor .elementor-column:has(.eduzah-courses-wrapper),
html body .elementor .elementor-widget-wrap:has(.eduzah-courses-wrapper),
html body .elementor .elementor-element:has(.eduzah-courses-wrapper),
html body .elementor .elementor-widget-shortcode:has(.eduzah-courses-wrapper),
html body .elementor .elementor-widget-container:has(.eduzah-courses-wrapper),
html body .elementor-section:has(.eduzah-courses-wrapper),
html body .elementor-container:has(.eduzah-courses-wrapper),
html body .elementor-widget-container:has(.eduzah-courses-wrapper) {
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
}

/* Target shortcode widget specifically */
html body .elementor .elementor-widget-shortcode,
html body .elementor .elementor-widget-shortcode .elementor-widget-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Last section before footer */
html body .elementor .elementor-section:last-child,
html body .elementor-section-wrap>.elementor-section:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ================================
   Reset & Base - Override Elementor
   ================================ */

html body .eduzah-courses-wrapper,
html body .elementor .eduzah-courses-wrapper,
html body .elementor-widget-container .eduzah-courses-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px !important;
    padding-top: 0 !important;
    padding-bottom: 40px !important;
    margin: 0 auto !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
    clear: both !important;
}

html body .eduzah-courses-wrapper *,
html body .eduzah-courses-grid,
html body .eduzah-courses-grid * {
    box-sizing: border-box !important;
}

html body .eduzah-courses-wrapper img,
html body .eduzah-courses-grid img {
    max-width: 100% !important;
    height: auto !important;
}

/* ================================
   Course Cards Grid
   ================================ */

html body .eduzah-courses-grid,
html body .elementor .eduzah-courses-grid {
    display: grid !important;
    gap: 30px !important;
    padding: 20px 0 40px 0 !important;
    margin: 0 auto !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 1200px !important;
}

html body .eduzah-courses-grid.columns-1 {
    grid-template-columns: 1fr !important;
    max-width: 400px !important;
}

html body .eduzah-courses-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

html body .eduzah-courses-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

html body .eduzah-courses-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 1024px) {

    html body .eduzah-courses-grid.columns-3,
    html body .eduzah-courses-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {

    html body .eduzah-courses-grid.columns-2,
    html body .eduzah-courses-grid.columns-3,
    html body .eduzah-courses-grid.columns-4 {
        grid-template-columns: 1fr !important;
        padding: 20px 15px !important;
    }
}

/* ================================
   Course Card
   ================================ */

html body .eduzah-courses-wrapper .eduzah-course-card,
html body .eduzah-courses-grid .eduzah-course-card,
html body .elementor .eduzah-course-card,
html body .eduzah-course-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
    -webkit-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #eee !important;
    min-height: auto !important;
    height: auto !important;
    position: relative !important;
}

html body .eduzah-courses-wrapper .eduzah-course-card:hover,
html body .eduzah-courses-grid .eduzah-course-card:hover,
html body .elementor .eduzah-course-card:hover,
html body .eduzah-course-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    -webkit-box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

/* Course Image */
html body .eduzah-course-card .eduzah-course-image,
html body .elementor .eduzah-course-card .eduzah-course-image {
    position: relative !important;
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .eduzah-course-card .eduzah-course-image img,
html body .elementor .eduzah-course-card .eduzah-course-image img {
    width: 100% !important;
    height: 100% !important;
    max-height: 200px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

html body .eduzah-course-placeholder,
html body .elementor .eduzah-course-placeholder {
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%) !important;
}

html body .eduzah-course-placeholder .dashicons,
html body .elementor .eduzah-course-placeholder .dashicons {
    font-size: 60px !important;
    width: 60px !important;
    height: 60px !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ================================
   Course Meta Info
   ================================ */

html body .eduzah-course-card .eduzah-course-meta,
html body .elementor .eduzah-course-card .eduzah-course-meta {
    padding: 15px 20px !important;
    direction: ltr !important;
    text-align: left !important;
    margin: 0 !important;
    background: #fff !important;
}

html body .eduzah-course-card .eduzah-meta-row,
html body .elementor .eduzah-course-card .eduzah-meta-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    width: auto !important;
}

html body .eduzah-course-card .eduzah-meta-row:last-child,
html body .elementor .eduzah-course-card .eduzah-meta-row:last-child {
    margin-bottom: 0 !important;
}

html body .eduzah-course-card .eduzah-meta-item,
html body .elementor .eduzah-course-card .eduzah-meta-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 13px !important;
    color: #666 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

html body .eduzah-course-card .eduzah-meta-item svg,
html body .elementor .eduzah-course-card .eduzah-meta-item svg {
    color: #999 !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
}

/* ================================
   Course Content
   ================================ */

html body .eduzah-course-card .eduzah-course-content,
html body .elementor .eduzah-course-card .eduzah-course-content {
    padding: 0 20px 15px !important;
    direction: ltr !important;
    text-align: left !important;
    flex-grow: 1 !important;
    margin: 0 !important;
    background: #fff !important;
}

html body .eduzah-course-card .eduzah-course-title,
html body .elementor .eduzah-course-card .eduzah-course-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #321D3D !important;
    justify-content: flex-start !important;
    line-height: 1.4 !important;
    background: none !important;
    border: none !important;
}

html body .eduzah-course-card .eduzah-eye-icon,
html body .elementor .eduzah-course-card .eduzah-eye-icon {
    color: #999 !important;
    display: flex !important;
    align-items: center !important;
}

html body .eduzah-course-card .eduzah-eye-icon svg,
html body .elementor .eduzah-course-card .eduzah-eye-icon svg {
    width: 18px !important;
    height: 18px !important;
}

html body .eduzah-course-card .eduzah-course-description,
html body .elementor .eduzah-course-card .eduzah-course-description {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: #646464 !important;
    background: none !important;
}

/* ================================
   Course Price
   ================================ */

html body .eduzah-course-card .eduzah-course-price,
html body .elementor .eduzah-course-card .eduzah-course-price {
    padding: 15px 20px !important;
    direction: ltr !important;
    text-align: left !important;
    margin: 0 !important;
    background: #fff !important;
}

html body .eduzah-course-card .eduzah-course-price .price-amount,
html body .elementor .eduzah-course-card .eduzah-course-price .price-amount {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #321D3D !important;
}

html body .eduzah-course-card .eduzah-course-price .price-currency,
html body .elementor .eduzah-course-card .eduzah-course-price .price-currency {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #321D3D !important;
    margin-left: 5px !important;
}

/* ================================
   Action Buttons
   ================================ */

html body .eduzah-course-card .eduzah-course-actions,
html body .elementor .eduzah-course-card .eduzah-course-actions {
    display: flex !important;
    gap: 10px !important;
    padding: 20px !important;
    direction: ltr !important;
    margin: 0 !important;
    background: #fff !important;
    margin-top: auto !important;
}

/* Single button - limit width */
html body .eduzah-course-card .eduzah-course-actions .eduzah-btn:only-child,
html body .elementor .eduzah-course-card .eduzah-course-actions .eduzah-btn:only-child {
    flex: 0 0 auto !important;
    max-width: 180px !important;
}

html body .eduzah-course-card .eduzah-btn,
html body .elementor .eduzah-course-card .eduzah-btn {
    flex: 1 !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border: none !important;
    display: inline-block !important;
    line-height: 1.4 !important;
}

html body .eduzah-course-card .eduzah-btn-details,
html body .elementor .eduzah-course-card .eduzah-btn-details {
    background: #D91B5B !important;
    color: #ffffff !important;
}

html body .eduzah-course-card .eduzah-btn-details:hover,
html body .elementor .eduzah-course-card .eduzah-btn-details:hover {
    background: #b8154d !important;
    color: #ffffff !important;
}

html body .eduzah-course-card .eduzah-btn-register,
html body .elementor .eduzah-course-card .eduzah-btn-register {
    background: #F59238 !important;
    color: #ffffff !important;
}

html body .eduzah-course-card .eduzah-btn-register:hover,
html body .elementor .eduzah-course-card .eduzah-btn-register:hover {
    background: #e07f26 !important;
    color: #ffffff !important;
}

/* ================================
   Registration Form
   ================================ */

html body .eduzah-registration-wrapper,
html body .elementor .eduzah-registration-wrapper {
    max-width: 500px !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
}

html body .eduzah-selected-course-banner,
html body .elementor .eduzah-selected-course-banner {
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 30px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    direction: ltr !important;
}

html body .eduzah-selected-course-info,
html body .elementor .eduzah-selected-course-info {
    color: #ffffff !important;
}

html body .eduzah-selected-course-info .eduzah-label,
html body .elementor .eduzah-selected-course-info .eduzah-label {
    display: block !important;
    font-size: 13px !important;
    opacity: 0.9 !important;
    margin-bottom: 5px !important;
}

html body .eduzah-selected-course-info .eduzah-course-name,
html body .elementor .eduzah-selected-course-info .eduzah-course-name {
    display: block !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

html body .eduzah-selected-course-info .eduzah-course-price-small,
html body .elementor .eduzah-selected-course-info .eduzah-course-price-small {
    display: inline-block !important;
    margin-top: 5px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 3px 10px !important;
    border-radius: 15px !important;
    font-size: 13px !important;
}

html body .eduzah-change-course,
html body .elementor .eduzah-change-course {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: background 0.3s ease !important;
}

html body .eduzah-change-course:hover,
html body .elementor .eduzah-change-course:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

/* Form Styles */
html body .eduzah-form,
html body .elementor .eduzah-form {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
    padding: 30px !important;
    direction: ltr !important;
    text-align: left !important;
}

html body .eduzah-form .eduzah-form-row,
html body .elementor .eduzah-form .eduzah-form-row {
    margin-bottom: 20px !important;
}

html body .eduzah-form .eduzah-form-row label,
html body .elementor .eduzah-form .eduzah-form-row label {
    display: block !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    color: #321D3D !important;
    font-size: 14px !important;
    letter-spacing: -0.01em !important;
}

html body .eduzah-form .eduzah-form-row label .required,
html body .elementor .eduzah-form .eduzah-form-row label .required {
    color: #D91B5B !important;
}

html body .eduzah-form .eduzah-form-row input[type="text"],
html body .eduzah-form .eduzah-form-row input[type="email"],
html body .eduzah-form .eduzah-form-row input[type="tel"],
html body .eduzah-form .eduzah-form-row select,
html body .elementor .eduzah-form .eduzah-form-row input[type="text"],
html body .elementor .eduzah-form .eduzah-form-row input[type="email"],
html body .elementor .eduzah-form .eduzah-form-row input[type="tel"],
html body .elementor .eduzah-form .eduzah-form-row select {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    direction: ltr !important;
    text-align: left !important;
    background: #fff !important;
    box-sizing: border-box !important;
}

html body .eduzah-form .eduzah-form-row input:focus,
html body .eduzah-form .eduzah-form-row select:focus,
html body .elementor .eduzah-form .eduzah-form-row input:focus,
html body .elementor .eduzah-form .eduzah-form-row select:focus {
    outline: none !important;
    border-color: #00b4db !important;
    box-shadow: 0 0 0 3px rgba(0, 180, 219, 0.1) !important;
}

html body .eduzah-form .eduzah-form-row input::placeholder,
html body .elementor .eduzah-form .eduzah-form-row input::placeholder {
    color: #999 !important;
}

/* Submit Button */
html body .eduzah-form .eduzah-form-submit,
html body .elementor .eduzah-form .eduzah-form-submit {
    margin-top: 30px !important;
}

html body .eduzah-form .eduzah-submit-btn,
html body .elementor .eduzah-form .eduzah-submit-btn {
    width: 100% !important;
    padding: 15px 30px !important;
    background: linear-gradient(135deg, #F59238 0%, #D91B5B 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

html body .eduzah-form .eduzah-submit-btn:hover,
html body .elementor .eduzah-form .eduzah-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 20px rgba(217, 27, 91, 0.3) !important;
}

html body .eduzah-form .eduzah-submit-btn:disabled,
html body .elementor .eduzah-form .eduzah-submit-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

html body .eduzah-form .eduzah-submit-btn .btn-loading,
html body .elementor .eduzah-form .eduzah-submit-btn .btn-loading {
    display: none !important;
    align-items: center !important;
    gap: 10px !important;
}

html body .eduzah-form .eduzah-submit-btn.loading .btn-text,
html body .elementor .eduzah-form .eduzah-submit-btn.loading .btn-text {
    display: none !important;
}

html body .eduzah-form .eduzah-submit-btn.loading .btn-loading,
html body .elementor .eduzah-form .eduzah-submit-btn.loading .btn-loading {
    display: inline-flex !important;
}

/* Spinner */
.spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Messages */
.eduzah-form-messages {
    margin-top: 20px;
}

.eduzah-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.eduzah-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* ================================
   No Courses Message
   ================================ */

.eduzah-no-courses {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ================================
   RTL Adjustments
   ================================ */

[dir="rtl"] .eduzah-course-meta,
[dir="rtl"] .eduzah-course-content,
[dir="rtl"] .eduzah-course-price,
[dir="rtl"] .eduzah-course-actions {
    direction: rtl;
    text-align: right;
}