/* macro-mode.css */

/* Page Flip Effect Container */
#page-flip-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 150px;
    /* Larger touch target */
    height: 150px;
    z-index: 9000;
    cursor: pointer;
    pointer-events: auto;
    overflow: hidden;
    /* Clip the corner triangle */
}

/* The "Page Peel" Triangle */
#page-flip-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 80px 80px 0;
    border-color: transparent #374151 transparent transparent;
    /* gray-700 */

    /* The "Peel" Look */
    border-bottom-left-radius: 12px;
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.4);

    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Hover State */
#page-flip-container:hover #page-flip-corner {
    border-width: 0 100px 100px 0;
    border-color: transparent #10b981 transparent transparent;
    /* green-500 */
    box-shadow: -8px 8px 20px rgba(16, 185, 129, 0.3);
    border-bottom-left-radius: 16px;
}

/* Active State (Macro Mode ON) */
body.macro-mode-active #page-flip-corner {
    border-width: 0 300px 300px 0;
    /* Much larger to indicate mode change */
    border-color: transparent #059669 transparent transparent;
    /* green-600 */
    box-shadow: -15px 15px 40px rgba(0, 0, 0, 0.6);
    border-bottom-left-radius: 40px;
}

/* Icon Styling */
#page-flip-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 9001;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
}

#page-flip-container:hover #page-flip-icon {
    color: white;
    top: 22px;
    right: 22px;
    transform: scale(1.1);
}

body.macro-mode-active #page-flip-icon {
    top: 60px;
    /* Move further in as the peel expands */
    right: 60px;
    color: white;
    transform: rotate(90deg) scale(1.5);
}

/* Full Screen Page Turn Overlay (Optional, for transition) */
#page-turn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(5, 150, 105, 0.1) 100%);
    z-index: 8999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.macro-mode-active #page-turn-overlay {
    opacity: 1;
}

/* Green Theme Overrides */
body.macro-mode-active #sidebar {
    border-right: 2px solid #059669;
    box-shadow: 4px 0 20px rgba(5, 150, 105, 0.15);
}

/* Macro Component Styling */
.macro-component {
    position: absolute;
    background: rgba(31, 41, 55, 0.95);
    /* gray-800 */
    border: 2px solid #059669;
    /* green-600 */
    border-radius: 0.75rem;
    padding: 1rem;
    width: 280px;
    /* Wider for config */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    /* Above connections (999) */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease;
}

.macro-component:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: #10b981;
    /* green-500 */
}

.macro-component-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.macro-component-title {
    font-weight: 700;
    color: #e5e7eb;
    font-size: 1rem;
}

.macro-component-icon {
    color: #10b981;
}

.macro-config-area {
    width: 100%;
    background-color: #111827;
    /* gray-900 */
    border: 1px solid #4b5563;
    color: #a7f3d0;
    /* green-200 */
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    resize: vertical;
    min-height: 80px;
}

.macro-config-area:focus {
    outline: none;
    border-color: #10b981;
    ring: 2px solid rgba(16, 185, 129, 0.2);
}

.macro-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Experimental Part Disabled State in Macro Mode */
.macro-component.experimental {
    border-color: #ef4444;
    /* red-500 */
    opacity: 0.6;
    pointer-events: none;
}

.macro-component.experimental::after {
    content: "EXPERIMENTAL - DISABLED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    border-radius: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Export Button in Macro Palette */
#macro-export-btn {
    width: 100%;
    background: linear-gradient(to right, #059669, #10b981);
    color: white;
    font-weight: bold;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 0;
    border-style: solid;
    border-width: 0 80px 80px 0;
    border-color: transparent #374151 transparent transparent;
    /* gray-700 */

    /* The "Peel" Look */
    border-bottom-left-radius: 12px;
    box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.4);

    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Hover State */
#page-flip-container:hover #page-flip-corner {
    border-width: 0 100px 100px 0;
    border-color: transparent #10b981 transparent transparent;
    /* green-500 */
    box-shadow: -8px 8px 20px rgba(16, 185, 129, 0.3);
    border-bottom-left-radius: 16px;
}

/* Active State (Macro Mode ON) */
body.macro-mode-active #page-flip-corner {
    border-width: 0 300px 300px 0;
    /* Much larger to indicate mode change */
    border-color: transparent #059669 transparent transparent;
    /* green-600 */
    box-shadow: -15px 15px 40px rgba(0, 0, 0, 0.6);
    border-bottom-left-radius: 40px;
}

/* Icon Styling */
#page-flip-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 9001;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
}

#page-flip-container:hover #page-flip-icon {
    color: white;
    top: 22px;
    right: 22px;
    transform: scale(1.1);
}

body.macro-mode-active #page-flip-icon {
    top: 60px;
    /* Move further in as the peel expands */
    right: 60px;
    color: white;
    transform: rotate(90deg) scale(1.5);
}

/* Full Screen Page Turn Overlay (Optional, for transition) */
#page-turn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(5, 150, 105, 0.1) 100%);
    z-index: 8999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.macro-mode-active #page-turn-overlay {
    opacity: 1;
}

/* Green Theme Overrides */
body.macro-mode-active #sidebar {
    border-right: 2px solid #059669;
    box-shadow: 4px 0 20px rgba(5, 150, 105, 0.15);
}

/* Macro Component Styling */
.macro-component {
    position: absolute;
    background: rgba(31, 41, 55, 0.95);
    /* gray-800 */
    border: 2px solid #059669;
    /* green-600 */
    border-radius: 0.75rem;
    padding: 1rem;
    width: 280px;
    /* Wider for config */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    /* Above connections (999) */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease;
}

.macro-component:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: #10b981;
    /* green-500 */
}

.macro-component-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.macro-component-title {
    font-weight: 700;
    color: #e5e7eb;
    font-size: 1rem;
}

.macro-component-icon {
    color: #10b981;
}

.macro-config-area {
    width: 100%;
    background-color: #111827;
    /* gray-900 */
    border: 1px solid #4b5563;
    color: #a7f3d0;
    /* green-200 */
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    resize: vertical;
    min-height: 80px;
}

.macro-config-area:focus {
    outline: none;
    border-color: #10b981;
    ring: 2px solid rgba(16, 185, 129, 0.2);
}

.macro-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Experimental Part Disabled State in Macro Mode */
.macro-component.experimental {
    border-color: #ef4444;
    /* red-500 */
    opacity: 0.6;
    pointer-events: none;
}

.macro-component.experimental::after {
    content: "EXPERIMENTAL - DISABLED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    border-radius: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Export Button in Macro Palette */
#macro-export-btn {
    width: 100%;
    background: linear-gradient(to right, #059669, #10b981);
    color: white;
    font-weight: bold;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#macro-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* Macro Palette Styling */
#macro-mode-palette {
    background: rgba(17, 24, 39, 0.8);
    /* gray-900 with opacity */
    backdrop-filter: blur(10px);
    border-left: 1px solid #374151;
    padding: 1.5rem;
}

#macro-mode-palette h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #059669;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.macro-input-group {
    margin-bottom: 1rem;
}

.macro-input-group label {
    display: block;
    font-size: 0.875rem;
    color: #d1d5db;
    /* gray-300 */
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.macro-input-group input[type="number"],
.macro-input-group input[type="text"] {
    width: 100%;
    background-color: #1f2937;
    /* gray-800 */
    border: 1px solid #4b5563;
    /* gray-600 */
    color: #f3f4f6;
    /* gray-100 */
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: border-color 0.2s, ring 0.2s;
}

.macro-input-group input[type="number"]:focus,
.macro-input-group input[type="text"]:focus {
    outline: none;
    border-color: #10b981;
    /* green-500 */
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.macro-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #1f2937;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #374151;
}

.macro-checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #10b981;
    cursor: pointer;
}

.macro-checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}