/* Base Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --light-gray: #ecf0f1;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

* {
    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: var(--background-color);
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
}

.settings-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Header & Navigation */
header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

nav li:hover {
    background-color: var(--light-gray);
}

nav li.active {
    border-bottom-color: var(--secondary-color);
}

nav li a {
    color: var(--primary-color);
    font-weight: 500;
}

nav li.logout {
    margin-left: auto;
}

/* Delete button with X icon */
.delete-category {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.delete-category:hover {
    opacity: 1;
    color: #c0392b;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--light-gray);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #dfe6e9;
    color: var(--primary-color);
}

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

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    height: 36px;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    color: white;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

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

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin: 0 0.5rem 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

textarea {
    min-height: 150px;
    resize: vertical;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    height: 36px; /* Standardhöjd för knappar */
    min-width: 100px; /* Minsta bredd för bättre klickbarhet */
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

/* Notes List */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
    max-width: 800px;
}

.note-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.note-category {
    font-weight: 500;
    color: var(--secondary-color);
}

.note-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.note-card p {
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Search and Filter */
.search-filter {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 700px;
    justify-content: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination a {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--light-gray);
}

/* Settings */
.settings-sections {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-section h2 {
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.categories-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.categories-list th,
.categories-list td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.categories-list th {
    font-weight: 600;
    background-color: var(--light-gray);
}

/* Messages */
.message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.login-container .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-container .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
}

.hint {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .notes-list {
        grid-template-columns: 1fr;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input[type="text"],
    .search-form select {
        max-width: 100%;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        padding: 0.75rem 1rem;
    }
    
    nav li.logout {
        margin-left: 0;
        border-top: 1px solid var(--border-color);
    }
    
    .form-row .form-group {
        flex: 1 1 100%;
        margin: 0 0 1rem 0;
    }
}
