/**
 * Frontend Stylesheet
 * File: assets/css/frontend-style.css
 */

/* Block Grid */
.rbm-block-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0;
}

@media (max-width: 1024px) {
    .rbm-block-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rbm-block-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.rbm-block-card {
    position: relative;
    border: 2px solid #14b8a6;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    display: block;
}

.rbm-block-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Default State */
.rbm-block-default {
    padding: 40px 20px;
    text-align: center;
    transition: opacity 0.2s ease;
}

.rbm-block-card:hover .rbm-block-default {
    opacity: 0;
}

.rbm-block-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.rbm-block-title {
    font-size: 14px;
    font-weight: 700;
    color: #991b1b;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Hover State */
.rbm-block-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #dbeafe 0%, #ffffff 100%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rbm-block-card:hover .rbm-block-hover {
    opacity: 1;
}

.rbm-hover-list {
    flex: 1;
}

.rbm-hover-item {
    color: #374151;
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 15px;
}

.rbm-hover-more {
    text-align: right;
    color: #991b1b;
    font-weight: 700;
    font-size: 14px;
}

.rbm-hover-default {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 14px;
}

/* Block Link */
.rbm-block-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

/* Color Classes */
.bg-teal-50 { background-color: #f0fdfa; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-purple-50 { background-color: #faf5ff; }

/* Single Block Page */
.rbm-single-block-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.rbm-block-header {
    margin-bottom: 40px;
}

.rbm-back-button {
    display: inline-block;
    padding: 10px 20px;
    background: #14b8a6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.rbm-back-button:hover {
    background: #0d9488;
    color: white;
}

.rbm-block-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 12px;
    color: white;
}

.rbm-block-icon-large {
    font-size: 60px;
}

.rbm-block-title-wrapper h1 {
    margin: 0;
    font-size: 32px;
    color: white;
}

.rbm-block-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.rbm-block-content h2,
.rbm-block-content h3,
.rbm-block-content h4 {
    color: #111827;
    margin-top: 30px;
    margin-bottom: 15px;
}

.rbm-block-content p {
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 15px;
}

.rbm-block-content ul,
.rbm-block-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.rbm-block-content li {
    margin-bottom: 10px;
    color: #4b5563;
}

/* Block Picker Modal */
#rbm-block-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.rbm-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.rbm-picker-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.rbm-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.rbm-picker-header h2 {
    margin: 0;
    font-size: 20px;
}

.rbm-picker-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: all 0.2s;
}

.rbm-picker-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.rbm-picker-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.rbm-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.rbm-picker-item {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rbm-picker-item:hover {
    border-color: #14b8a6;
    background: #f0fdfa;
}

.rbm-picker-item.selected {
    border-color: #14b8a6;
    background: #ccfbf1;
}

.rbm-picker-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.rbm-picker-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.rbm-picker-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #14b8a6;
    border-radius: 50%;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.rbm-picker-item.selected .rbm-picker-check {
    display: flex;
}

.rbm-picker-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .rbm-block-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .rbm-block-title-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .rbm-block-title-wrapper h1 {
        font-size: 24px;
    }
    
    .rbm-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}