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

:root {
    --primary-color: #007BFF;
    --primary-hover: #0056b3; 
    --accent-color: #28a745; 
    --text-primary: #212529;  
    --text-secondary: #6c757d;
    --bg-color: #f8f9fa;     
    --surface-color: #ffffff; 
    --border-color: #dee2e6;
    --danger-color: #dc3545;
    --danger-hover: #c82333;

    --font-family: 'Inter', sans-serif;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.07);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

header {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

nav{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    max-width: 1100px;
    max-width: 900px;
}

nav h1{
    font-size: 1.9rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links{
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.nav-links a{
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.nav-links a:hover{
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: 700;
    /* font-weight: 600; */
    border-bottom-color: var(--primary-color);
}

#logout{
    background-color: rgb(228, 39, 39);
    color: white;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}
#logout:hover {
    background-color: var(--danger-hover);
    transform: translateY(-2px);
}


main{
    max-width: 800px;
    /* max-width: 900px; */
    margin: 2.5rem auto;
    padding: 0 1rem;
}

.All-posts-title{
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.All-posts-title p{
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0.2rem 0;
}


.postcontainer{
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.postcontainer .post{
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    /* padding: 1.5rem; */
    transition: var(--transition);
}

/* .post:hover {
    box-shadow: var(--shadow-md);
    border-color: #ced4da;
    transform: translateY(-4px);
} */

.post-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.post-head h3{
    color: var(--primary-color);
    font-size: 1.2rem;
    /* font-size: 1.2rem; */
    font-weight: 600;
}

.post .date{
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post .content{
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
    line-height: 1.7;
}

.see-more-btn, .see-less-btn {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.5rem;
    display: inline-block;
}

.see-more-btn:hover, .see-less-btn:hover {
    text-decoration: underline;
}


.post-foot{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.like{
    display: flex;
    align-items: center;
    padding: 0.5rem;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.like i {
  font-size: 1.5rem;
  /* font-size: 1.25rem; */
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.like i:hover {
transform: scale(1.2);
}

.like i.active {
color: var(--primary-color);
  transform: scale(1.1);
}

.post-foot .btns{
    display: flex;
    gap: 1rem;
}
.post-foot .btns a{
    text-decoration: none;
    font-weight: 600; 
    transition: var(--transition);
    /* padding: 0.5rem 1rem; */
    /* background-color: #f9fafb; */
    /* border-radius: 10px; */
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1); */
}

.post-foot .btns .delete{ color: red;}
.post-foot .btns .edit {color: rgb(32, 149, 9);}

.post-foot .btns .delete:hover { color: var(--danger-hover); }
.post-foot .btns .edit:hover { color: #1e7e34; }

.post.fading-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.profile-card{
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 1rem;
}

.profile-info {
    text-align: left;
}

.name-heading{
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-card .username {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

.profile-card .email {
    color: var(--text-secondary);
    font-size: 1rem;
}


.profile-actions {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.profile-actions p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.create-btn{
    display: inline-block;
    text-decoration: none;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.create-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.your-posts-title{
    /* font-weight: 500;
    margin: 0.5rem 0.8rem; */
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.emptymsg{
    /* color: red;
    text-align: center;
    margin: 1rem;
    font-size: 1.5rem; */
    color: var(--text-secondary);
    text-align: center;
    margin: 3rem 0;
    font-size: 1.2rem;
    font-style: italic;
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
}

.form-card {
    max-width: 500px; 
    margin: 6rem auto;
    padding: 2.5rem; 
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.form-card h1 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.Auth-form-card form div,
.form-card form div {
    margin-bottom: 1.5rem;
}

.form-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-card textarea {
    width: 100%;
    min-height: 150px;
    /* resize: vertical; */
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: var(--transition);
}

.form-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#Create {
    width: 100%;
    padding: 0.9rem;
    border-radius: var(--border-radius);
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#Create:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn:disabled, #Create:disabled, .edit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.Auth-form-card{
    max-width: 500px; 
    margin: 2.5rem auto;
    padding: 2.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.Auth-form-card h1 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    /* margin-bottom: 2rem; */
}

.Auth-form-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}
.Auth-form-card input {
    width: 100%;
    padding: 0.8rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: var(--transition);
}

.Auth-form-card input:focus{
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}
.Auth-form-card .btn{
    width: 100%;
    padding: 0.9rem;
    border-radius: var(--border-radius);
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.Auth-form-card .btn:hover{
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.error-message {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1); 
    border: 1px solid var(--danger-color);
    padding: 0.8rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 500;
}

.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh; 
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color); 
    border-top-color: var(--primary-color); 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


@media (max-width: 600px) {
    header {
        padding: 1rem;
    }
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    main {
        margin-top: 1.5rem;
    }
    .form-card, .Auth-form-card {
        margin: 2rem auto;
        padding: 1.5rem;
    }
    .profile-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .profile-actions {
        width: 100%;
        align-items: flex-start;
        margin-top: 1rem;
    }
}