/**
 * Mudos Store - Frontend Styles
 * Version: 1.2.0
 */

/* ============================================
   Animations
   ============================================ */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ============================================
   General Styles
   ============================================ */

.mudos-store-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.mudos-store-notice.mudos-store-info {
    background: #e7f3ff;
    border-color: #2196F3;
    color: #0d47a1;
}

.mudos-store-notice.mudos-store-error {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.mudos-store-notice.mudos-store-success {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

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

.mudos-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.mudos-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.mudos-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

.mudos-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.mudos-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.mudos-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ============================================
   Checkout Page
   ============================================ */

.mudos-store-checkout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.mudos-checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .mudos-checkout-container {
        grid-template-columns: 1fr;
    }
}

.mudos-checkout-order-review,
.mudos-checkout-payment {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mudos-checkout-order-review h2,
.mudos-checkout-payment h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* Cart Items */

.mudos-cart-items {
    margin-bottom: 20px;
}

.mudos-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
}

.mudos-cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
}

.mudos-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mudos-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
}

.mudos-no-image .dashicons {
    font-size: 40px;
    color: #999;
}

.mudos-cart-item-details {
    flex: 1;
}

.mudos-cart-item-details h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mudos-cart-item-license {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.mudos-cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.mudos-remove-from-cart {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    transition: color 0.2s ease;
}

.mudos-remove-from-cart:hover {
    color: #f44336;
}

.mudos-remove-from-cart .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Cart Total */

.mudos-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #ffffff;
}

.mudos-cart-total-label {
    font-size: 18px;
    font-weight: 600;
}

.mudos-cart-total-amount {
    font-size: 28px;
    font-weight: 700;
}

/* Payment Form */

.mudos-form-section {
    margin-bottom: 30px;
}

.mudos-form-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mudos-form-row {
    margin-bottom: 20px;
}

.mudos-form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.mudos-form-row input[type="text"],
.mudos-form-row input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.mudos-form-row input:focus {
    outline: none;
    border-color: #667eea;
}

/* Stripe Card Element */

.mudos-card-element {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    transition: border-color 0.3s ease;
}

.mudos-card-element:focus-within {
    border-color: #667eea;
}

.mudos-card-errors {
    color: #f44336;
    font-size: 14px;
    margin-top: 8px;
}

.mudos-payment-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mudos-payment-icons img {
    height: 24px;
    opacity: 0.7;
}

.mudos-secure-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #4caf50;
    font-size: 14px;
    font-weight: 600;
}

.mudos-secure-badge .dashicons {
    color: #4caf50;
}

/* Submit Button */

#mudos-submit-payment {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    position: relative;
}

#mudos-submit-payment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mudos-btn-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mudos-btn-spinner .dashicons {
    animation: mudos-spin 1s linear infinite;
}

@keyframes mudos-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mudos-payment-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    display: none;
}

.mudos-payment-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.mudos-payment-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.mudos-checkout-footer {
    margin-top: 20px;
}

.mudos-secure-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
}

.mudos-secure-notice .dashicons {
    color: #4caf50;
}

/* ============================================
   Account Page
   ============================================ */

.mudos-store-account {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.mudos-account-header {
    margin-bottom: 30px;
}

.mudos-account-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.mudos-account-welcome {
    font-size: 16px;
    color: #666;
}

/* Account Navigation */

.mudos-account-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.mudos-account-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.mudos-account-nav-item:hover {
    color: #667eea;
}

.mudos-account-nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.mudos-account-nav-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Account Content */

.mudos-account-section h2 {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* Downloads Grid */

.mudos-downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.mudos-download-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mudos-download-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.mudos-download-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #e0e0e0;
}

.mudos-download-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mudos-download-details {
    padding: 20px;
}

.mudos-download-details h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mudos-download-meta {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.mudos-download-meta code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.mudos-download-version {
    font-size: 14px;
    color: #999;
}

.mudos-download-actions {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mudos-download-actions .mudos-btn {
    justify-content: center;
    width: 100%;
}

/* Licenses Table */

.mudos-licenses-table-wrapper {
    overflow-x: auto;
}

.mudos-licenses-table {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mudos-licenses-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.mudos-licenses-table th,
.mudos-licenses-table td {
    padding: 15px 20px;
    text-align: left;
}

.mudos-licenses-table th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.mudos-licenses-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.mudos-licenses-table tbody tr:hover {
    background: #f9f9f9;
}

.mudos-license-key {
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
}

.mudos-license-type {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mudos-license-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mudos-license-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.mudos-license-status-expired {
    background: #ffebee;
    color: #c62828;
}

.mudos-license-status-disabled {
    background: #f5f5f5;
    color: #999;
}

/* Orders List */

.mudos-orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mudos-order-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mudos-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.mudos-order-number strong {
    font-size: 16px;
    color: #333;
}

.mudos-order-date {
    display: block;
    font-size: 14px;
    color: #999;
    margin-top: 5px;
}

.mudos-status-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mudos-status-pending {
    background: #fff3e0;
    color: #e65100;
}

.mudos-status-processing {
    background: #e3f2fd;
    color: #0d47a1;
}

.mudos-status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.mudos-status-failed {
    background: #ffebee;
    color: #c62828;
}

.mudos-status-refunded {
    background: #f5f5f5;
    color: #999;
}

.mudos-order-body {
    padding: 20px;
}

.mudos-order-items {
    margin-bottom: 15px;
}

.mudos-order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.mudos-order-item-row:last-child {
    border-bottom: none;
}

.mudos-order-item-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.mudos-order-item-license {
    color: #666;
    font-size: 14px;
    margin: 0 15px;
}

.mudos-order-item-price {
    font-weight: 600;
    color: #667eea;
}

.mudos-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 18px;
}

/* ============================================
   Markdown Content Styles
   ============================================ */

.mudos-markdown-content {
    line-height: 1.8;
    color: #333;
}

.mudos-markdown-content h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 1.5em 0 0.75em;
    color: #1a1a1a;
    line-height: 1.3;
}

.mudos-markdown-content h2 {
    font-size: 1.75em;
    font-weight: 700;
    margin: 1.5em 0 0.75em;
    color: #1a1a1a;
    line-height: 1.3;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e0e0e0;
}

.mudos-markdown-content h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin: 1.25em 0 0.6em;
    color: #333;
    line-height: 1.4;
}

.mudos-markdown-content h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 1em 0 0.5em;
    color: #333;
}

.mudos-markdown-content p {
    margin: 0 0 1.25em;
    line-height: 1.8;
}

.mudos-markdown-content ul,
.mudos-markdown-content ol {
    margin: 0 0 1.5em;
    padding-left: 2em;
}

.mudos-markdown-content ul {
    list-style-type: disc;
}

.mudos-markdown-content ol {
    list-style-type: decimal;
}

.mudos-markdown-content li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

.mudos-markdown-content li:last-child {
    margin-bottom: 0;
}

.mudos-markdown-content strong {
    font-weight: 600;
    color: #1a1a1a;
}

.mudos-markdown-content em {
    font-style: italic;
}

.mudos-markdown-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #d63384;
}

.mudos-markdown-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.mudos-markdown-content a:hover {
    border-bottom-color: #667eea;
}

.mudos-markdown-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #667eea;
    background: #f8f9fa;
    color: #555;
    font-style: italic;
}

.mudos-markdown-content pre {
    background: #f5f5f5;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.mudos-markdown-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.mudos-markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.mudos-markdown-content table th,
.mudos-markdown-content table td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.mudos-markdown-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

.mudos-markdown-content table tr:nth-child(even) {
    background: #f9f9f9;
}

/* First heading in content should have no top margin */
.mudos-markdown-content > h1:first-child,
.mudos-markdown-content > h2:first-child,
.mudos-markdown-content > h3:first-child {
    margin-top: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .mudos-account-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mudos-account-nav-item {
        white-space: nowrap;
    }

    .mudos-downloads-grid {
        grid-template-columns: 1fr;
    }

    .mudos-licenses-table {
        font-size: 14px;
    }

    .mudos-licenses-table th,
    .mudos-licenses-table td {
        padding: 10px;
    }

    .mudos-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mudos-markdown-content {
        font-size: 0.95em;
    }

    .mudos-markdown-content h1 {
        font-size: 1.75em;
    }

    .mudos-markdown-content h2 {
        font-size: 1.5em;
    }

    .mudos-markdown-content h3 {
        font-size: 1.25em;
    }
}

/* ============================================
   Tailwind Utility Classes - Critical for Plugin
   ============================================ */

/* Rounded utilities - !important to override any conflicting styles */
.rounded-full {
    border-radius: 9999px !important;
}

/* More specific targeting for badge elements */
span.rounded-full,
.bg-gradient-to-r.rounded-full,
.px-2.py-1.rounded-full,
div.flex.flex-wrap span.rounded-full {
    border-radius: 9999px !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.rounded-xl {
    border-radius: 0.75rem !important;
}

.rounded-2xl {
    border-radius: 1rem !important;
}

/* Shadow utilities */
.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Gradient utilities */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-blue-500 {
    --tw-gradient-from: #3b82f6;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(59, 130, 246, 0));
}

.to-purple-500 {
    --tw-gradient-to: #a855f7;
}

/* Text size utilities */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Spacing utilities */
.gap-1\.5 {
    gap: 0.375rem;
}

.gap-1 {
    gap: 0.25rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Font weight */
.font-semibold {
    font-weight: 600;
}

/* Display utilities */
.inline-block {
    display: inline-block;
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

/* Width utilities */
.w-3 {
    width: 0.75rem;
}

.h-3 {
    height: 0.75rem;
}

/* Position utilities */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Z-index */
.z-50 {
    z-index: 50;
}

/* Min width */
.min-w-\[200px\] {
    min-width: 200px;
}

/* Background colors */
.bg-white {
    background-color: #ffffff;
}

.bg-gray-200 {
    background-color: #e5e7eb;
}

.bg-gray-300 {
    background-color: #d1d5db;
}

.bg-gray-700 {
    background-color: #374151;
}

/* Text colors */
.text-white {
    color: #ffffff;
}

.text-gray-700 {
    color: #374151;
}

/* Border utilities */
.border {
    border-width: 1px;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

/* Padding utilities */
.p-3 {
    padding: 0.75rem;
}

/* Margin utilities */
.mt-2 {
    margin-top: 0.5rem;
}

/* Transition */
.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

/* Hover states */
.hover\:bg-gray-300:hover {
    background-color: #d1d5db;
}

/* Hidden utility */
.hidden {
    display: none;
}

/* Top/Left positioning */
.top-full {
    top: 100%;
}

.left-0 {
    left: 0;
}

/* SVG stroke */
.stroke-current {
    stroke: currentColor;
}

/* Stroke line cap */
[stroke-linecap="round"] {
    stroke-linecap: round;
}

[stroke-linejoin="round"] {
    stroke-linejoin: round;
}

[stroke-width="2"] {
    stroke-width: 2;
}
