/* custom.css */
/* Global Styles and Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --text-color: #333;
    --text-light: #777;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    padding-top: 80px; /* Account for fixed navbar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Header and Navigation */
.navbar {
    background-color: var(--primary-color);
    border: none;
    border-radius: 0;
    padding: 0.8rem 0;
    box-shadow: var(--box-shadow);
}

.navbar-fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

.navbar-inverse {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    float: left;
}

#logo:hover {
    text-decoration: none;
    color: var(--light-color);
}

.navbar-nav {
    display: flex;
    align-items: center;
    float: right;
}

.navbar-nav > li {
    margin-left: 20px;
    list-style-type: none; /* Remove bullet points */
}

.navbar-nav > li > a {
    color: white;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--border-radius);
}

.navbar-nav > li > a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

/* Clear floats */
.navbar::after {
    content: "";
    display: table;
    clear: both;
}

/* Footer */
.footer {
    background-color: transparent; /* Remove background */
    color: var(--text-color);
    padding: 1.5rem 0;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer small {
    display: inline; /* Keep content in one line */
    margin-bottom: 0;
}

.footer a {
    color: var(--secondary-color);
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

.footer nav ul li {
    margin: 0;
    display: inline-block;
}

/* Jumbotron */
.jumbotron {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
    box-shadow: var(--box-shadow);
}

.jumbotron h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.jumbotron h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.jumbotron p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    color: white;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    color: white;
    text-decoration: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    border-radius: var(--border-radius);
}

/* Forms */
form {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* User profile */
h1 .gravatar {
    margin-right: 15px;
    border-radius: 50%;
    border: 3px solid var(--light-color);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 90px;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        float: none;
    }

    .navbar-nav > li {
        margin: 5px 0;
        width: 100%;
    }

    #logo {
        float: none;
        text-align: center;
        margin-bottom: 10px;
    }

    .jumbotron {
        padding: 2rem 1rem;
    }

    .jumbotron h1 {
        font-size: 2rem;
    }

    /* Fix footer layout */
    .footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
    }

    .footer small {
        margin: 0;
    }

    .footer nav ul {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 1rem;
    }

    .footer nav ul li {
        margin: 0;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Fix the Create my account button position */
form .btn {
    margin-top: 1.5rem; /* Adds space above the button */
    display: block; /* Makes it a block element */
    width: 100%; /* Full width within the form */
}

/* Optional: Add some spacing between the last input and the button */
input[type="password"] {
    margin-bottom: 0.5rem; /* Adds space after the last password field */
}

/* Error Messages Styling */
#error_explanation {
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fdf7f7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
}

#error_explanation ul {
    margin: 0;
    padding-left: 20px;
}

#error_explanation li {
    color: #e74c3c;
    margin: 5px 0;
    list-style-type: disc;
}

/* Optional: Add some animation for better UX */
#error_explanation {
    animation: fadeIn 0.3s ease-in;
}

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

/* Field with errors - red border styling */
.field_with_errors input[type="text"],
.field_with_errors input[type="email"],
.field_with_errors input[type="password"],
.field_with_errors textarea,
.field_with_errors select {
    border: 2px solid #d9534f !important;
    border-radius: 4px;
}

/* Optional: Add red color to the label too */
.field_with_errors label {
    color: #d9534f;
    font-weight: bold;
}

/* Flash message styling */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
}

/* Success messages (green) */
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Error/danger messages (red) */
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Warning messages (yellow) */
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Info messages (blue) */
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Notice messages (default to info blue) */
.alert-notice {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown menu styling */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    font-size: 14px;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ccc;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.428571429;
    color: #333;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f5f5f5;
    color: #262626;
    text-decoration: none;
}

.dropdown-menu .divider {
    height: 1px;
    margin: 9px 0;
    overflow: hidden;
    background-color: #e5e5e5;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-menu {
    display: block;
}

/* Caret styling */
.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Mobile navigation styles */
.navbar-toggle {
    display: none;
    float: right;
    padding: 9px 10px;
    margin-top: 8px;
    margin-right: 15px;
    margin-bottom: 8px;
    background-color: transparent;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background-color: white;
    margin: 4px 0;
}

/* Mobile styles */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    #navbar-menu {
        display: none;
        width: 100%;
        float: none;
        clear: both;
    }

    #navbar-menu.active {
        display: block;
    }

    #navbar-menu li {
        float: none;
        text-align: center;
    }

    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        text-align: center;
    }
}

/* Users index */

.users {
    list-style: none;
    margin: 0;

    li {
        overflow: auto;
        padding: 10px 0;
        border-bottom: 1px solid #ccc;
    }
}

/* Pagination */

.pagination {
    text-align: center;
    padding: 20px 0;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: black;
}

.pagination .current {
    color: black;
}

.pagination a:hover {
    background: #d8d8e0;
}

/* Microposts styling */
.microposts {
    list-style: none;
    padding: 0;
}

.microposts li {
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
}

.microposts li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.microposts .content {
    display: block;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.microposts .timestamp {
    color: var(--text-light);
    font-size: 0.9rem;
    display: block;
    margin-top: 0.5rem;
}

.microposts .user {
    font-weight: 600;
    color: var(--primary-color);
}

.microposts .gravatar {
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid var(--light-color);
}

/* User info styling */
.user_info {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-header .gravatar {
    border-radius: 50%;
    border: 3px solid var(--light-color);
    flex-shrink: 0;
}

.user-details h1 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Micropost form styling */
.field textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
    font-family: inherit;
}

.field textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.field textarea::placeholder {
    color: var(--text-light);
    font-style: italic;
}

/* Micropost form submit button */
.micropost-form .btn {
    margin-top: 1rem;
    width: auto;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Optional: Add some spacing around the form */
form {
    margin-bottom: 2rem;
}

/* User stats styling */
.stats {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.stats a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid var(--light-color);
}

.stats a:hover {
    background-color: var(--light-color);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.stats a:hover .stat {
    color: var(--primary-color);
}

/* Responsive design for stats */
@media (max-width: 576px) {
    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stats a {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem;
    }

    .stat {
        margin-bottom: 0;
        font-size: 1.25rem;
    }
}
