/**
 * CC Framework - Gutenberg Blocks Styles
 * Custom Block Editor Styles for Semantic Rooms
 * Matches Corporate Design: #1D1459, #9C8B7C, #F4B643
 * 
 * @package CC_Framework
 * @version 4.1.0
 */

/* =================================================================
   CSS VARIABLES (Inherited from framework.css)
   ================================================================= */

.cc-gutenberg-blocks {
    /* Use framework variables */
    --cc-primary: #1D1459;
    --cc-secondary: #9C8B7C;
    --cc-accent: #F4B643;
    --cc-border-radius: 12px;
    --cc-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --cc-shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --cc-shadow-medium: 0 4px 15px rgba(0,0,0,0.15);
}

/* =================================================================
   BLOCK: ROOM NAVIGATION
   ================================================================= */

.cc-room-navigation {
    margin: 25px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-room-navigation.cc-layout-horizontal .cc-room-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-room-navigation.cc-layout-vertical .cc-room-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-room-item {
    margin: 0;
}

.cc-room-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--cc-border);
    border-radius: var(--cc-border-radius);
    text-decoration: none;
    color: var(--cc-text);
    transition: all var(--cc-transition);
    box-shadow: var(--cc-shadow-light);
}

.cc-room-link:hover {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-medium);
    transform: translateY(-2px);
}

.cc-room-icon {
    font-size: 24px;
    line-height: 1;
}

.cc-room-name {
    font-weight: 600;
    color: var(--cc-primary);
}

.cc-room-counter {
    margin-left: auto;
    padding: 4px 12px;
    background: var(--cc-accent);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* =================================================================
   BLOCK: ROOM OVERVIEW
   ================================================================= */

.cc-room-overview {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: var(--cc-border-radius);
    box-shadow: var(--cc-shadow-medium);
}

.cc-room-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--cc-border);
}

.cc-room-header .cc-room-icon {
    font-size: 48px;
}

.cc-room-title {
    margin: 0;
    color: var(--cc-primary);
    font-size: 28px;
    font-weight: 700;
}

.cc-room-description {
    margin: 15px 0 25px;
    color: var(--cc-text-light);
    line-height: 1.6;
}

.cc-room-content .cc-content-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-content-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--cc-border);
}

.cc-content-item:last-child {
    border-bottom: none;
}

.cc-content-item a {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--cc-transition);
}

.cc-content-item a:hover {
    color: var(--cc-accent);
}

/* =================================================================
   BLOCK: CONTENT GALLERY
   ================================================================= */

.cc-content-gallery {
    margin: 30px 0;
}

.cc-gallery-grid {
    display: grid;
    gap: 20px;
}

.cc-content-gallery[data-columns="2"] .cc-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

.cc-content-gallery[data-columns="3"] .cc-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}

.cc-content-gallery[data-columns="4"] .cc-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
}

.cc-gallery-item {
    background: white;
    border-radius: var(--cc-border-radius);
    overflow: hidden;
    box-shadow: var(--cc-shadow-light);
    transition: all var(--cc-transition);
}

.cc-gallery-item:hover {
    box-shadow: var(--cc-shadow-medium);
    transform: translateY(-5px);
}

.cc-item-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.cc-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--cc-transition);
}

.cc-gallery-item:hover .cc-item-image img {
    transform: scale(1.05);
}

.cc-item-content {
    padding: 20px;
}

.cc-item-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.cc-item-title a {
    color: var(--cc-primary);
    text-decoration: none;
}

.cc-item-title a:hover {
    color: var(--cc-accent);
}

.cc-item-excerpt {
    color: var(--cc-text-light);
    font-size: 14px;
    line-height: 1.5;
}

.cc-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--cc-text-light);
}

/* =================================================================
   BLOCK: ROOM STATS
   ================================================================= */

.cc-room-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
}

.cc-stat-item {
    flex: 1 1 200px;
    padding: 20px;
    background: white;
    border-radius: var(--cc-border-radius);
    box-shadow: var(--cc-shadow-light);
    text-align: center;
    transition: all var(--cc-transition);
}

.cc-stat-item:hover {
    box-shadow: var(--cc-shadow-medium);
    transform: translateY(-3px);
}

.cc-stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--cc-text-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--cc-primary);
}

/* =================================================================
   BLOCK: ROOM SELECTOR
   ================================================================= */

.cc-room-selector {
    margin: 30px 0;
}

.cc-selector-grid {
    display: grid;
    gap: 20px;
}

.cc-room-selector[data-columns="2"] .cc-selector-grid {
    grid-template-columns: repeat(2, 1fr);
}

.cc-room-selector[data-columns="3"] .cc-selector-grid {
    grid-template-columns: repeat(3, 1fr);
}

.cc-room-selector[data-columns="4"] .cc-selector-grid {
    grid-template-columns: repeat(4, 1fr);
}

.cc-selector-item {
    background: white;
    border-radius: var(--cc-border-radius);
    overflow: hidden;
    box-shadow: var(--cc-shadow-light);
    transition: all var(--cc-transition);
}

.cc-selector-item:hover {
    box-shadow: var(--cc-shadow-heavy);
    transform: translateY(-5px);
}

.cc-selector-link {
    display: block;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--cc-text);
}

.cc-selector-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.cc-selector-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--cc-primary);
    margin-bottom: 8px;
}

.cc-selector-desc {
    font-size: 14px;
    color: var(--cc-text-light);
    line-height: 1.5;
}

/* =================================================================
   BLOCK: BREADCRUMBS
   ================================================================= */

.cc-breadcrumbs {
    margin: 20px 0;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: var(--cc-border-radius);
    font-size: 14px;
}

.cc-breadcrumbs a {
    color: var(--cc-primary);
    text-decoration: none;
    transition: color var(--cc-transition);
}

.cc-breadcrumbs a:hover {
    color: var(--cc-accent);
}

.cc-breadcrumbs .separator {
    margin: 0 8px;
    color: var(--cc-text-light);
}

.cc-breadcrumbs .current-room,
.cc-breadcrumbs .current-page {
    color: var(--cc-text);
    font-weight: 600;
}

/* =================================================================
   BLOCK: CROSS LINKS
   ================================================================= */

.cc-cross-links {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: var(--cc-border-radius);
    box-shadow: var(--cc-shadow-light);
}

.cc-cross-links h3 {
    margin: 0 0 15px;
    color: var(--cc-primary);
    font-size: 20px;
}

.cc-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-links-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--cc-border);
}

.cc-links-list li:last-child {
    border-bottom: none;
}

.cc-links-list a {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--cc-transition);
}

.cc-links-list a:hover {
    color: var(--cc-accent);
}

/* =================================================================
   BLOCK: LANGUAGE SWITCHER
   ================================================================= */

.cc-language-switcher {
    margin: 20px 0;
}

.cc-language-list {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cc-lang-item a {
    display: block;
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--cc-border);
    border-radius: var(--cc-border-radius);
    color: var(--cc-text);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--cc-transition);
}

.cc-lang-item a:hover {
    border-color: var(--cc-primary);
    background: var(--cc-primary);
    color: white;
}

/* =================================================================
   BLOCK: ROOM ASSIGNMENT
   ================================================================= */

.cc-room-assignment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: var(--cc-border-radius);
    font-size: 14px;
    margin: 15px 0;
}

.cc-assignment-label {
    color: var(--cc-text-light);
}

.cc-assignment-room {
    color: var(--cc-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--cc-transition);
}

.cc-assignment-room:hover {
    color: var(--cc-accent);
}

/* =================================================================
   BLOCK: FRAMEWORK STATUS
   ================================================================= */

.cc-framework-status {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: var(--cc-border-radius);
    box-shadow: var(--cc-shadow-light);
}

.cc-status-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--cc-border);
}

.cc-status-item:last-child {
    border-bottom: none;
}

.cc-status-label {
    color: var(--cc-text-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cc-status-value {
    color: var(--cc-primary);
    font-weight: 600;
    margin-left: 10px;
}

.cc-module-list {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
}

.cc-module-list li {
    padding: 5px 0;
    font-size: 14px;
}

.cc-module-active {
    color: #28a745;
}

.cc-module-inactive {
    color: #dc3545;
}

/* =================================================================
   BLOCK ERROR STATES
   ================================================================= */

.cc-block-error,
.cc-block-notice {
    padding: 15px 20px;
    border-radius: var(--cc-border-radius);
    margin: 20px 0;
}

.cc-block-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.cc-block-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media screen and (max-width: 768px) {
    .cc-content-gallery[data-columns="3"] .cc-gallery-grid,
    .cc-content-gallery[data-columns="4"] .cc-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cc-room-selector[data-columns="3"] .cc-selector-grid,
    .cc-room-selector[data-columns="4"] .cc-selector-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cc-room-navigation.cc-layout-horizontal .cc-room-list {
        flex-direction: column;
    }
    
    .cc-room-stats {
        flex-direction: column;
    }
}

@media screen and (max-width: 480px) {
    .cc-content-gallery .cc-gallery-grid,
    .cc-room-selector .cc-selector-grid {
        grid-template-columns: 1fr;
    }
    
    .cc-room-overview {
        padding: 15px;
    }
    
    .cc-room-title {
        font-size: 22px;
    }
}

/* =================================================================
   GUTENBERG EDITOR SPECIFIC STYLES
   ================================================================= */

.editor-styles-wrapper .cc-room-navigation,
.editor-styles-wrapper .cc-room-overview,
.editor-styles-wrapper .cc-content-gallery {
    margin: 20px 0;
}

/* Ensure blocks look good in editor */
.block-editor-block-list__block .cc-room-link,
.block-editor-block-list__block .cc-selector-link {
    pointer-events: none; /* Prevent clicks in editor */
}
