/* Microsoft Word Style Ribbon Interface */

.ribbon-container {
    width: 100%;
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Ribbon Tabs */
.ribbon-tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #d1d5db;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ribbon-tab {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.ribbon-tab:hover {
    background: #f9fafb;
    color: #1f2937;
}

.ribbon-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #f3f4f6;
}

/* Ribbon Content */
.ribbon-content {
    display: none;
    padding: 8px 16px;
    background: #f3f4f6;
}

.ribbon-content.active {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Ribbon Groups */
.ribbon-group {
    display: flex;
    flex-direction: column;
    padding: 4px 12px;
    border-right: 1px solid #d1d5db;
    min-width: fit-content;
}

.ribbon-group:last-child {
    border-right: none;
}

.ribbon-group-label {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin-top: 4px;
    font-weight: 500;
}

.ribbon-group-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

/* Ribbon Buttons */
.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
}

.ribbon-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.ribbon-btn:active {
    background: #d1d5db;
}

.ribbon-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

.ribbon-btn-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.ribbon-btn-label {
    font-size: 11px;
    color: #374151;
    text-align: center;
}

/* Small Ribbon Buttons (for grouped actions) */
.ribbon-btn-small {
    padding: 6px 10px;
    min-width: 40px;
    border-radius: 3px;
}

.ribbon-btn-small .ribbon-btn-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.ribbon-btn-small .ribbon-btn-label {
    font-size: 10px;
}

/* Color Buttons for Drawing Tools */
.ribbon-color-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ribbon-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ribbon-color-btn.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Thickness Buttons */
.ribbon-thickness-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ribbon-thickness-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ribbon-thickness-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Shape Buttons */
.ribbon-shape-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.ribbon-shape-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ribbon-shape-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ribbon-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .ribbon-group {
        padding: 4px 8px;
    }
    
    .ribbon-btn {
        min-width: 50px;
        padding: 6px 8px;
    }
    
    .ribbon-btn-icon {
        font-size: 20px;
    }
    
    .ribbon-btn-label {
        font-size: 10px;
    }
}
