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

/* ===== RESET ===== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{
    --bg:#080816;
    --bg2:#10172d;
    --card:#18213f;
    --border:rgba(255,255,255,.08);
    --text:#ffffff;
    --secondary:#a7acc4;

    --accent1:#ff5e78;
    --accent2:#ffb347;

    --shadow:
    0 8px 32px rgba(0,0,0,.35);

    --blur:blur(18px);
}

body.light{
    --bg:#f4f7fc;
    --bg2:#ffffff;
    --card:#ffffff;
    --text:#101010;
    --secondary:#555;
    --border:rgba(0,0,0,.08);
}

body{
    font-family:'Poppins',sans-serif;
    min-height:100vh;
    color:var(--text);

    background:
    radial-gradient(circle at top left,
    rgba(255,94,120,.18),
    transparent 25%),

    radial-gradient(circle at bottom right,
    rgba(0,160,255,.15),
    transparent 30%),

    linear-gradient(
    135deg,
    var(--bg),
    var(--bg2)
    );

    padding:30px;
}


/* ===== HEADER ===== */

header{
    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:40px;
    padding-bottom:20px;

    border-bottom:1px solid var(--border);
}

header h1{
    font-size:3rem;
    font-weight:700;

    background:
    linear-gradient(
    90deg,
    var(--accent1),
    var(--accent2)
    );

    -webkit-background-clip:text;
    color:transparent;
}

header div{
    display:flex;
    gap:15px;
}


/* ===== BUTTONS ===== */

.add-note-btn,
.theme-toggle-btn,
.edit-btn,
.delete-btn,
.save-btn,
.cancel-btn{

    border:none;
    cursor:pointer;
    transition:.35s;
    font-family:inherit;
}

.add-note-btn{

    padding:14px 25px;

    border-radius:40px;

    color:white;

    background:
    linear-gradient(
    90deg,
    var(--accent1),
    var(--accent2)
    );

    font-weight:600;
}

.add-note-btn:hover{
    transform:translateY(-3px);
}

.theme-toggle-btn{

    width:50px;
    height:50px;

    border-radius:50%;
    font-size:1rem;

    background:var(--card);
    color:var(--text);

    border:1px solid var(--border);
}


/* ===== NOTES GRID ===== */

.notes-grid{

    display:grid;

    grid-template-columns:
    repeat(auto-fill,minmax(300px,1fr));

    gap:30px;
}


/* ===== NOTE CARD ===== */

.note-card{

    background:
    rgba(255,255,255,.03);

    backdrop-filter:var(--blur);

    border-radius:25px;

    border:1px solid var(--border);

    padding:25px;

    box-shadow:var(--shadow);

    overflow:hidden;

    position:relative;

    transition:.35s;
}

.note-card:hover{

    transform:
    translateY(-6px);

    border-color:
    var(--card-color);
}

.note-card::before{

    content:"";

    position:absolute;

    top:0;
    left:0;

    width:100%;
    height:4px;

    background:
    var(--card-color);
}

.note-card h3{

    margin-bottom:10px;
    font-size:1.35rem;
}

.note-card p{

    color:var(--secondary);
    margin-bottom:18px;

    line-height:1.6;
}


/* ===== IMAGE ===== */

.note-img{

    width:100%;
    height:180px;

    object-fit:cover;

    border-radius:15px;

    margin-bottom:15px;
}


/* ===== META ===== */

.note-meta{

    margin-top:10px;
    margin-bottom:15px;

    color:var(--secondary);
    font-size:.8rem;
}


/* ===== ACTIONS ===== */

.note-actions{

    display:flex;
    gap:10px;
}

.edit-btn,
.delete-btn{

    flex:1;

    padding:12px;

    border-radius:12px;

    background:transparent;

    color:var(--text);

    border:1px solid var(--border);
}

.edit-btn:hover{

    background:
    rgba(255,255,255,.08);
}

.delete-btn:hover{

    background:
    rgba(255,0,0,.2);
}


/* ===== DIALOG ===== */

dialog{

    margin:auto;

    border:none;

    border-radius:25px;

    overflow:hidden;

    background:transparent;
}

dialog::backdrop{

    background:
    rgba(0,0,0,.7);

    backdrop-filter:blur(6px);
}

.dialog-content{

    width:500px;
    max-width:95vw;

    padding:35px;

    background:
    var(--card);

    border-radius:25px;

    border:1px solid var(--border);

    box-shadow:var(--shadow);
}

.dialog-header{

    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:25px;
}

.dialog-title{

    font-size:1.8rem;
}

.close-btn{

    width:40px;
    height:40px;

    border:none;
    border-radius:50%;

    cursor:pointer;

    background:
    rgba(255,255,255,.08);

    color:white;
}


/* ===== FORM ===== */

.form-group{

    margin-bottom:20px;
}

.form-label{

    display:block;
    margin-bottom:10px;

    font-size:.9rem;
}

.form-input,
.form-textarea{

    width:100%;
    padding:15px;

    border-radius:15px;

    border:1px solid var(--border);

    background:
    rgba(255,255,255,.04);

    color:var(--text);

    outline:none;
}

.form-textarea{

    min-height:140px;
    resize:none;
}

.form-input:focus,
.form-textarea:focus{

    border-color:
    var(--accent1);
}


/* ===== IMAGE PREVIEW ===== */

#imagePreview{

    width:100%;
    max-height:220px;

    border-radius:15px;

    object-fit:cover;

    display:none;
}


/* ===== DIALOG BUTTONS ===== */

.dialog-actions{

    display:flex;
    justify-content:flex-end;
    gap:15px;

    margin-top:20px;
}

.cancel-btn{

    padding:12px 25px;

    background:transparent;

    border-radius:30px;

    color:var(--secondary);

    border:1px solid var(--border);
}

.save-btn{

    padding:12px 25px;

    border-radius:30px;

    color:white;

    background:
    linear-gradient(
    90deg,
    var(--accent1),
    var(--accent2)
    );
}


/* ===== EMPTY STATE ===== */

.empty-state{

    text-align:center;

    padding:50px;

    color:var(--secondary);

    grid-column:1/-1;
}


/* ===== FOOTER ===== */

footer{

    margin-top:60px;

    text-align:center;

    color:var(--secondary);

    border-top:1px solid var(--border);

    padding-top:25px;
}


/* ===== MOBILE ===== */

@media(max-width:768px){

header{

    flex-direction:column;
    gap:20px;
}

header h1{

    font-size:2rem;
}

.note-card{

    padding:20px;
}

.dialog-content{

    padding:25px;
}
}
