/*--------------------------------- GLOBAL --------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Playwrite+RO:wght@100..400&family=Rakkas&family=Tilt+Warp&display=swap');
/* font-family: "Tilt Warp", sans-serif; */
/* font-family: "Playwrite RO", cursive; */
/* font-family: "Rakkas", serif; */
/* font-family: "JetBrains Mono", monospace; */

* {
    margin: 0;
    padding: 0;
    font-family: consolas;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #333;
    font-family: "JetBrains Mono", monospace;
    color: white;
}

.love {
    font-size: 2.5rem;
}

.logo {
    color: black;
    font-weight: 200;
    font-size: 2rem;
    font-family: "Tilt Warp", sans-serif; 
    text-shadow: 0 0 15px rgb(117, 117, 117);
    transition: text-shadow 0.3s ease-out;
}

.logo:hover {
    text-shadow: 0 0 15px white;
} 

.node { 
    cursor: pointer; 
    font-family: monospace;
    padding: 1px 0;
    margin: 0;
    line-height: 1.2;
}

.node:hover {
  box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.2);
}

.children { 
    margin-left: 20px; 
}


/*--------------------------------- HEADER --------------------------------- */

header {
    flex-shrink: 0;
    position: relative;
    padding: 0.75rem 3rem;
    background-image: url("https://res.cloudinary.com/dbjhbabjd/image/upload/v1768586947/header_bg_lq6flp.jpg");
    background-size: cover;
    background-position: center;
}

header>* {
    position: relative;
    z-index: 2;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.8));
    pointer-events: none;
    z-index: 1;
}


/*--------------------------------- FOOTER --------------------------------- */
footer {
    flex-shrink: 0;
    display: flex;
    position: relative;
    padding: 0.75rem 3rem;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.7));
}

footer > h1 {
    font-family: "Playwrite RO", cursive;
    font-weight: 900;
    font-size: 1.5rem;
}

nav {
    font-size: 2.25rem;
    background-color: #666;
    border-radius: 0.5rem;
    padding: 0.5rem 0.8rem;
}

nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

nav i {
    display: block;
    transform: scale(1);
    color: black;
    position: relative;
    transition: all 0.35s ease-in-out;
    padding: 4px 1px;
    border-radius: 6px;
}

nav i:hover {
    color: white;
    box-shadow: 0 2px 2px 2px rgba(0, 0, 0, 0.3);
}

nav i::after {
    background-color: white;
    position: absolute;
    z-index: -1
}


/*--------------------------------- MAIN --------------------------------- */

main {
    flex-grow: 1;
    background-color: #333;
    display: flex;
    justify-content: flex-start;
    padding: 2rem;
    gap: 2rem;
}

/*---------------- output-section ----------------*/
#formatted-code {
    width: 100%;
    height: 20rem;
    padding: 1rem 0;
    font-family: "JetBrains Mono", monospace;
    font-size: 1.15rem;
    border-radius: 1rem;
    background-color: #444;
    color: #ddd;
    border: 1px solid #555;
    overflow: auto;                 /* Scrollbar behavior */
    resize: vertical horizontal;
    flex-grow: 1;
    transition: all 0.3s ease-in-out;
    cursor: text; /* Indicates it's readable text */
    outline: none;
}

#formatted-code:hover {
    border-color: #666;
    background-color: #484848;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#formatted-code:focus-within {
    border-color: #888;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    background-color: #4a4a4a;
}


.left-container {
    display: flex;
    flex-direction: column;
    width: 50vw;
    min-width: 300px;
}

.right-container {
    display: flex;
    flex-direction: column;
    width: 50vw;
    min-width: 300px;
}

/*---------------- label ----------------*/
main label {
    font-family: "Rakkas", serif;    
    font-weight: 500;
    letter-spacing: 1.5px;
    font-size: 2rem;
    color: #AAA;
    text-align: left;
}

/*---------------- button ----------------*/
button {
    align-self: center;
    background-color: #444;
    font-family: "Rakkas", serif;
    padding: 0.6rem 3rem;
    border-radius: 0.8rem;
    font-size: 1.2rem;
    color: #AAA;
    cursor: pointer;
    transition: all 0.2s ease-out;
    margin-top: 1rem;
    border: none;
}

button:hover {
    background-color: #666;
    color: white;
    scale: 1.1;
    box-shadow: 0 10px 5px 2px #222;
}


/*---------------- Editor ----------------*/
.editor {
    height: 20rem;      /* fixed height  */
    flex-grow: 1;
    display: flex;
    background-color: #444;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid transparent; 
    transition: all 0.3s ease-in-out;
}

.editor:hover {
    border-color: #666;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.editor:focus-within {
    border-color: #888;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    background-color: #4a4a4a;
}

#editor-text {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    font-family: "JetBrains Mono", monospace;
    white-space: pre;
    overflow: auto;
    resize: none;
    color: white;
    background-color: #444;
    font-size: 1.15rem;
    line-height: 1.5rem;
}

#gutter {
    border: none;
    resize: none;
    overflow: hidden;
    padding: 1rem 0.5rem;
    background: #555;
    color: #999;
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    font-size: 1.15rem;
    line-height: 1.5rem;
    user-select: none;
    flex: none;
    width: 3rem;
    white-space: pre;
    outline: none;
    vertical-align: top;     /* Forces text to stick to the top */
}

/*--------------------------------- TreeView --------------------------------- */
.node-wrapper {
    display: flex;
    flex-direction: column;
}

.node-row {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    transition: background 0.1s;
    user-select: none;
    white-space: nowrap;
    min-width: max-content;
}

.node-row.hover-effect:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.toggle-icon {
    display: inline-block;
    width: 20px;           /* Fixed width ensures text aligns even if arrow changes */
    text-align: center;
    color: #888;
    margin-right: 5px;
    font-size: 2rem;
}

.gear-icon {
    font-size: 1.2rem;  
    vertical-align: middle; 
    margin-right: 8px;
    margin-top: -4px;           /* micro-adjustment */
    opacity: 0.8;               /* micro-adjustment */
}

.widget-label {
    color: #ffd700;     /* Gold for Widgets (Class Names) */
}

.props-label {
    color: #4ec9b0;     /* Teal for "props" */
    font-weight: normal;
    font-style: italic;
}

.key {
    color: #9cdcfe;     /* Light Blue for property keys */
    margin-right: 8px;
}

.value {
    color: #ce9178;    /* Orange/Red for string values */
}
.value.type-number {
    color: #b5cea8;    /* Green for numbers */
}
.value.type-object {      /* For null */
    color: #569cd6;
}


/*---------------- Error State ----------------*/
.error-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;             /* Fills the parent container */
    width: 100%;
    color: #ff6b6b;           /* Soft pastel red - looks good on dark bg */
    text-align: center;
    white-space: normal;      /* Important: overrides <pre> behavior so text wraps */
}

.error-msg i {
    font-size: 3rem;          /* Big icon */
    margin-bottom: 1rem;
    color: #ff4757;           /* Slightly darker red for the icon */
}

.error-msg h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ffa5a5;
}

.error-msg p {
    color: #ccc;
    font-size: 1rem;
}

.error-msg small {
    display: block;
    margin-top: 1.5rem;
    color: #777;
    font-size: 0.85rem;
    font-family: "JetBrains Mono", monospace;
}

/* Ensure the inner output div fills the container */
#formatted-output {
    height: 100%;
    width: 100%;
    margin: 0;
}
    

/*---------------- Custom Scrollbar ----------------*/
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent; 
    margin: 0.5rem;
}

::-webkit-scrollbar-thumb {
    background-color: #666;
    border-radius: 99px;
    border: 3px solid #444; /* Creates the padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #888;
    border-color: #444;
}

::-webkit-scrollbar-corner {
    background: transparent;
}


/*---------------- Placeholder State ----------------*/
.placeholder-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #666; /* Faint grey */
    user-select: none; /* User can't select this text */
}

.placeholder-msg i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #888;
}

.placeholder-msg p {
    font-family: "JetBrains Mono", monospace;
    font-size: 1rem;
    font-style: italic;
}


/*--------------------------------- Media Queries --------------------------------- */
@media screen and (max-width: 768px) {
    main, footer {
        flex-direction: column;
    }
    
    .left-container, .right-container {
        width: 100%;
    }
    
    footer h1, footer span {
        font-size: 0.75rem;
    }
    
    main label {
        font-size: 1.5rem;
    }
    
    main label {
        font-size: 1.25rem;
    }
    
    nav {
        font-size: 1.8rem;
        width: 60%;
        justify-content: space-evenly;
        border: 2px solid #222;
    }
    
    .name {
        font-size: 1.8rem;
    }
  
    .me {
      font-size: 1.4rem;
    }
    
    header {
        padding: 0.45rem 2rem;
    }
    
    footer {
        gap: 1rem;
        text-align: center;
    }
    
    footer h1 span {
        display: block;
    }
}   

