/* assets/css/style.css */

/* --- 1. Core Setup --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
:root { --font-primary: 'Poppins', sans-serif; --text-light: #f0f0f0; --text-dark: #cccccc; --border-glass: rgba(255, 255, 255, 0.2); --blur-effect: 15px; --border-radius: 16px; --clr-dashboard: #00a8e8; --glow-dashboard: rgba(0, 168, 232, 0.5); --clr-history: #f9c80e; --glow-history: rgba(249, 200, 14, 0.5); --clr-logout: #ef233c; --glow-logout: rgba(239, 35, 60, 0.5); --clr-login: #8338ec; --glow-login: rgba(131, 56, 236, 0.5); --clr-signup: #06d6a0; --glow-signup: rgba(6, 214, 160, 0.5); }
* { box-sizing: border-box; }
body { font-family: var(--font-primary); margin: 0; color: var(--text-light); background: #0d1117; overflow-x: hidden; min-height: 100vh; position: relative; }
body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: linear-gradient(125deg, #ef233c, #8338ec, #00a8e8, #06d6a0); background-size: 400% 400%; animation: animated-gradient 20s ease infinite; filter: blur(150px); opacity: 0.3; }
@keyframes animated-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; }
main { padding-top: 80px; }
body:has(.hero) main { padding-top: 0; }

/* --- 2. Header & Navigation (Simplified) --- */
header { z-index: 1000; background: rgba(13, 17, 23, 0.8); backdrop-filter: blur(10px); width: 100%; position: fixed; top: 0; left: 0; border-bottom: 1px solid var(--border-glass); }
nav .container { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo { font-size: 1.3rem; font-weight: 700; color: #fff; text-decoration: none; }
.nav-menu { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-link { color: #fff; font-weight: 500; padding: 8px 12px; border-radius: 8px; text-decoration: none; display: inline-block; transition: all 0.3s ease; font-size: 0.9rem; white-space: nowrap; }
.nav-link:hover { transform: scale(1.05); color: #fff; }
.btn-logout { padding: 8px 10px; font-size: 1.1rem; }
a[href*="/dashboard"] { background-color: var(--clr-dashboard); } a[href*="/history"] { background-color: var(--clr-history); } a[href*="/login"] { background-color: var(--clr-login); } .btn-logout { background-color: var(--clr-logout); } .btn-primary { background-color: var(--clr-signup); }

/* --- 3. Hero & Features Section --- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 80px 20px 0; box-sizing: border-box; }
.hero h1 { font-size: 2.5rem; } .hero p { font-size: 1.1rem; } .btn-large { padding: 15px 30px; font-size: 1.1rem; }
.features { padding: 80px 20px; } .section-title { font-size: 2rem; } .feature-item h3 { font-size: 1.3rem; }
.hero .container, .feature-item { animation: slideUpFadeIn 1s ease-out forwards; opacity: 0; transform: translateY(30px); }
.hero h1, .section-title { font-weight: 700; color: #fff; line-height: 1.2; text-shadow: 0 5px 20px rgba(0,0,0,0.5); margin: 20px 0; text-align: center; }
.hero p, .feature-item p { margin-bottom: 40px; color: var(--text-dark); max-width: 600px; margin-left: auto; margin-right: auto; }
.btn-large { display: inline-block; font-weight: 600; border-radius: 50px; text-decoration: none; color: #fff; background: var(--clr-signup); box-shadow: 0 0 30px var(--glow-signup); transition: all 0.3s ease; }
.btn-large:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 0 40px var(--glow-signup); }
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
.feature-icon { font-size: 3rem; margin-bottom: 20px; }
.feature-item:nth-child(1) .icon-glow { color: var(--clr-dashboard); } .feature-item:nth-child(2) .icon-glow { color: var(--clr-history); } .feature-item:nth-child(3) .icon-glow { color: var(--clr-signup); }
.feature-item:hover { transform: translateY(-10px); }
.glass-container { background: rgba(30, 30, 40, 0.5); backdrop-filter: blur(var(--blur-effect)); -webkit-backdrop-filter: blur(var(--blur-effect)); border: 1px solid var(--border-glass); border-radius: var(--border-radius); padding: 30px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.animated-container { animation: slideUpFadeIn 0.8s ease-out forwards; opacity: 0; transform: translateY(30px); }
@keyframes slideUpFadeIn { to { opacity: 1; transform: translateY(0); } }

/* --- 4. Forms (Login, Signup, Shortener) - FINAL FIX --- */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 80px); padding: 20px 0; }
.auth-form { width: 100%; max-width: 420px; text-align: center; }
.dashboard .shorten-form-wrapper { max-width: 700px; margin: 0 auto; padding-top: 40px; }
.input-group { position: relative; display: flex; align-items: center; margin-bottom: 25px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-glass); border-radius: 12px; transition: all 0.3s ease; }
.input-group:focus-within { border-color: var(--clr-login); box-shadow: 0 0 15px var(--glow-login); }
.input-group i { padding: 0 15px; color: var(--text-dark); transition: color 0.3s ease; }
.input-group:focus-within i { color: var(--clr-login); }
.input-group input { flex-grow: 1; padding: 15px 15px 15px 0; background: transparent; border: none; color: var(--text-light); font-size: 1rem; font-family: var(--font-primary); }
.input-group input:focus { outline: none; }
#shorten-form .input-group { flex-grow: 1; }
#shorten-form { display: flex; flex-direction: column; gap: 15px; } 
#shorten-form button { width: 100%; }
.btn-submit, #shorten-form button { padding: 15px; border-radius: 12px; border: none; color: #fff; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.btn-submit { background-color: var(--clr-login); box-shadow: 0 0 20px var(--glow-login); }
#shorten-form button { background: var(--clr-dashboard); box-shadow: 0 0 20px var(--glow-dashboard); }
.btn-submit:hover, #shorten-form button:hover { transform: scale(1.05); }

/* --- 5. Result & History --- */
.result-container { margin-top: 30px; max-height: 0; opacity: 0; transform: translateY(-20px); transition: all 0.5s ease; overflow: hidden; }
.result-container.show { max-height: 200px; opacity: 1; transform: translateY(0); }
.short-url-box { display: flex; flex-direction: column; gap: 10px; }
#short-url { cursor: pointer; word-break: break-all; }
.desktop-history { display: none; }
.mobile-history .link-card { margin-bottom: 20px; }
.link-card .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.link-card .serial-number { background-color: var(--clr-dashboard); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: 600; }
.link-card .card-label { font-size: 0.9rem; color: var(--text-dark); margin: 0 0 5px; }
.link-card .original-url-cell { word-break: break-all; margin: 0; line-height: 1.5; }
.link-card .card-divider { border: 0; height: 1px; background-image: linear-gradient(to right, transparent, var(--border-glass), transparent); margin: 15px 0; }
.link-card .short-url-text a { color: var(--clr-signup); font-weight: 600; text-decoration: none; word-break: break-all; }
.link-card .card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.link-card .clicks-info { text-align: center; }
.link-card .clicks-info strong { font-size: 1.5rem; display: block; color: var(--clr-history); }
.edit-url-input { width: 100%; padding: 10px 15px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--clr-history); box-shadow: 0 0 15px var(--glow-history); border-radius: 8px; color: var(--text-light); font-family: var(--font-primary); font-size: 1rem; }
.btn-action { background: none; border: none; cursor: pointer; font-size: 1.2rem; transition: transform 0.2s ease; padding: 5px; } .btn-action:hover { transform: scale(1.2); } .btn-edit { color: var(--clr-history); } .btn-save { color: var(--clr-signup); } .btn-cancel { color: var(--clr-logout); }

/* --- 6. Desktop Styles (min-width: 769px) --- */
@media (min-width: 769px) {
    main { padding-top: 110px; } .logo { font-size: 1.8rem; }
    .nav-menu { flex-direction: row; gap: 12px; }
    .nav-link { font-size: 1rem; padding: 10px 20px; }
    .btn-logout { padding: 10px 12px; }
    header { background: transparent; position: absolute; border: none; }
    header.scrolled { background: rgba(13, 17, 23, 0.8); border-bottom: 1px solid var(--border-glass); }
    .hero h1 { font-size: 4rem; } .hero p { font-size: 1.3rem; } .section-title { font-size: 2.5rem; }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
    #shorten-form { flex-direction: row; } 
    .input-group { flex-grow: 1; }
    #shorten-form button { width: auto; }
    .short-url-box { flex-direction: row; }
    .mobile-history { display: none; }
    .desktop-history { display: table; width: 100%; border-collapse: collapse; }
    .desktop-history th, .desktop-history td { padding: 18px 15px; text-align: left; border-bottom: 1px solid var(--border-glass); }
    .desktop-history th { color: var(--text-dark); }
    .desktop-history .original-url-cell { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}