@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- Base Styles & Background --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f0c29;
    background-image: linear-gradient(to right top, #0f0c29, #1c1b3a, #2b2a4c, #3c3a5f, #4d4b72);
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.7;
}

.blob.one {
    width: 450px;
    height: 450px;
    background: rgba(108, 99, 255, 0.6);
    top: -20%;
    left: -10%;
    animation: move-blob-1 20s infinite alternate;
}

.blob.two {
    width: 350px;
    height: 350px;
    background: rgba(255, 60, 172, 0.6);
    bottom: -15%;
    right: -15%;
    animation: move-blob-2 18s infinite alternate;
}

.blob.three {
    width: 250px;
    height: 250px;
    background: rgba(0, 242, 254, 0.5);
    bottom: 25%;
    left: 20%;
    animation: move-blob-3 15s infinite alternate;
}

@keyframes move-blob-1 {
    from { transform: translate(-20%, 10%) scale(1); }
    to { transform: translate(20%, -10%) scale(1.2); }
}
@keyframes move-blob-2 {
    from { transform: translate(15%, -10%) scale(1); }
    to { transform: translate(-15%, 10%) scale(0.8); }
}
@keyframes move-blob-3 {
    from { transform: translate(5%, 5%) scale(1); }
    to { transform: translate(-5%, -5%) scale(1.1); }
}


/* --- Glassmorphism Container Style --- */
.glass-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 40px;
    text-align: center;
    max-width: 800px;
    width: 100%;
}

/* --- General Element Styling --- */
h1, h2, h3 {
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 600;
}

p {
    margin-bottom: 15px;
    line-height: 1.7;
    font-weight: 300;
}

a {
    color: #00f2fe;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

a:hover {
    color: #ff3cac;
    text-shadow: 0 0 5px rgba(255, 60, 172, 0.7);
}

/* --- Form & Button Styles --- */
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: #f0f0f0;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: box-shadow 0.3s ease, border 0.3s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border: 1px solid rgba(0, 242, 254, 0.8);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

button, .btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 1px;
}

button[type="submit"], .btn {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: #fff;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
button[type="submit"]::before, .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff3cac, #784ba0);
    transition: left 0.4s ease;
    z-index: -1;
}
button[type="submit"]:hover::before, .btn:hover::before {
    left: 0;
}
button[type="submit"]:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}


button.google-login {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 20px;
}

button.google-login:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

small {
    display: block;
    margin: -10px 0 15px 0;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Page Specifics --- */

/* Index Page */
.hero h2 {
    font-size: 2.5em;
    font-weight: 700;
}
.features {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.feature {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
@media (min-width: 600px) {
    .feature {
        width: 30%;
    }
}


/* Dashboard Page */
.user-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
}
.user-info p {
    margin: 5px 0;
}
.preview {
    margin-bottom: 20px;
}
#preview-iframe {
    width: 100%;
    height: 300px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #fff; /* Opaque background for the content inside */
}
.upload-section button {
    background: #784ba0;
    color: white;
}
.upload-section button:hover {
     background: #ff3cac;
     box-shadow: 0 0 20px rgba(255, 60, 172, 0.5);
}

footer {
    margin-top: 30px;
    opacity: 0.7;
    font-weight: 300;
}

.register-link {
    margin-top: 20px;
    font-size: 14px;
}

.register-link a {
    font-weight: 600;
}

/* --- Profile Link in Nav --- */
.profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    background: rgba(0,0,0,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.3s ease;
}
.profile-link:hover {
    background: rgba(0,0,0,0.4);
    color: #fff;
}
.profile-icon {
    font-size: 24px;
}

/* --- Logout Button --- */
#logout-button {
    margin-top: 20px;
    background: #c52b2b;
    color: white;
}
#logout-button:hover {
    background: #ff3c3c;
    box-shadow: 0 0 20px rgba(255, 60, 60, 0.5);
}

/* --- New Dashboard Layout --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
    width: 100vw;
    padding: 20px;
    gap: 20px;
}

#sidebar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 30px;
}

#dashboard-nav ul {
    list-style: none;
}

#dashboard-nav li {
    margin-bottom: 10px;
}

#dashboard-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

#dashboard-nav .nav-link .icon {
    font-size: 20px;
}

#dashboard-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#dashboard-nav .nav-link.active {
    background: rgba(0, 242, 254, 0.8);
    color: #1a1a2e;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-footer #logout-button {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(255, 60, 60, 0.6);
}
.sidebar-footer #logout-button:hover {
    background: rgba(255, 60, 60, 0.8);
}

#main-content {
    overflow-y: auto;
    padding-right: 10px; /* For scrollbar */
}

/* --- View Switching --- */
.view {
    display: none;
}

.active-view {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-container-inner {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
}

/* --- Dashboard Component Styles --- */
.name-input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.name-input-group input {
    flex-grow: 1;
}
.name-input-group button {
    width: auto;
    padding: 0 25px;
}

#final-url {
    color: #00f2fe;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
}

.editor-container {
    padding: 0;
    overflow: hidden;
}

#code-editor {
    width: 100%;
    height: 50vh;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    outline: none;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    padding: 20px;
    resize: vertical;
    border-radius: 15px;
}