/* -- style.css -- */

/* Generel Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

    /* Dark Mode */
    body.dark-mode {
        background-color: #121212;
        color: #e0e0e0;
    }

.container {
    max-width: 1200px;
    margin: auto;
}

h1, h2 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    color: #343a40;
}

body.dark-mode h1, body.dark-mode h2 {
    border-bottom-color: #ff8c00; /* Orange accent */
    color: #f0f0f0;
}

hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 20px 0;
}

body.dark-mode hr {
    border-top-color: #444;
}

/* Top Bar & Knapper */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.create-btn {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

    .create-btn:hover {
        background-color: #218838;
    }

/* Filter & Backup Kontroller */
#filter-controls, #backup-controls {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

body.dark-mode #filter-controls, body.dark-mode #backup-controls {
    background: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}


/* NYT: Specifik styling for backup-sektionen */
#backup-controls {
    grid-template-columns: 1fr 2fr;
    align-items: center;
}

    #backup-controls h2 {
        margin: 0;
        border: none;
        padding: 0;
        font-size: 1.2em;
        grid-column: 1 / -1;
    }

#import-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#filter-controls label {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
}

body.dark-mode #filter-controls label {
    color: #ccc;
}

#filter-controls input,
#filter-controls select,
#backup-controls button,
#backup-controls input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

body.dark-mode #filter-controls input,
body.dark-mode #filter-controls select,
body.dark-mode #backup-controls button,
body.dark-mode #backup-controls input {
    background-color: #333;
    color: #f0f0f0;
    border-color: #555;
}

#backup-controls button {
    cursor: pointer;
    background-color: #17a2b8;
    color: white;
    font-weight: bold;
}

    #backup-controls button:hover {
        background-color: #138496;
    }
/* -- Slut på ny styling -- */

input[type="date"] {
    position: relative;
}

    input[type="date"]::-webkit-datetime-edit-fields-wrapper {
        text-align: left;
    }

    input[type="date"]:not(:valid)::before {
        content: "dd-mm-åååå";
        color: #6c757d;
        position: absolute;
        left: 10px;
        top: 10px;
    }

/* Portfolio Liste (index.html) */
#portfolio-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.portfolio-entry {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    overflow-wrap: break-word;
}

    .portfolio-entry:hover {
        background-color: #fdfdfd;
    }

body.dark-mode .portfolio-entry {
    background: #1e1e1e;
    border-color: #444;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

    body.dark-mode .portfolio-entry:hover {
        background-color: #282828;
    }


.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.entry-header-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0056b3;
}

body.dark-mode .entry-header-info h3 {
    color: #ff8c00; /* Orange accent */
}


.entry-meta {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 15px;
}

body.dark-mode .entry-meta {
    color: #aaa;
}


.entry-meta span {
    margin-right: 15px;
    font-weight: bold;
}

.entry-goal {
    margin-top: 10px;
}

.entry-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    border-top: 1px solid #e9ecef;
    margin-top: 15px;
    padding-top: 15px;
    cursor: default;
}

body.dark-mode .entry-details {
    border-top-color: #444;
}

.entry-section-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #495057;
}

body.dark-mode .entry-section-title {
    color: #ccc;
}

.collapsible-content {
    display: none;
    margin-top: 10px;
}

    .collapsible-content.visible {
        display: block;
    }

.portfolio-entry img, .portfolio-entry video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "Fira Code", "Courier New", monospace;
    max-height: 400px;
    overflow-y: auto;
}

.toggle-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 5px;
}

    .toggle-btn:hover {
        background-color: #5a6268;
    }

.entry-actions {
    position: absolute;
    top: 15px;
    right: 15px;
}

.edit-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

    .edit-btn:hover {
        background-color: #5a6268;
    }

/* Form Styling (create.html & edit.html) */
.form-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body.dark-mode .form-container {
    background: #1e1e1e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

body.dark-mode .form-header {
    border-bottom-color: #ff8c00; /* Orange accent */
}


.form-header h1 {
    margin: 0;
    padding: 0;
    border: none;
}

.back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

body.dark-mode .back-link {
    color: #ff8c00; /* Orange accent */
}

.form-group {
    margin-bottom: 15px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }

body.dark-mode .form-group label {
    color: #ccc;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background-color: #333;
    color: #f0f0f0;
    border-color: #555;
}

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

.current-file {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

body.dark-mode .current-file {
    color: #aaa;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-button {
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    text-align: center;
}

.save-btn {
    background-color: #28a745;
}

    .save-btn:hover {
        background-color: #218838;
    }

.delete-btn {
    background-color: #dc3545;
}

    .delete-btn:hover {
        background-color: #c82333;
    }

#create-btn {
    background-color: #007bff;
}

body.dark-mode #create-btn {
    background-color: #ff8c00; /* Orange accent */
}

#create-btn:hover {
    background-color: #0056b3;
}

body.dark-mode #create-btn:hover {
    background-color: #e07b00;
}

/* Add this new rule to force word wrapping in specific areas */
.entry-goal p, .entry-details p {
    overflow-wrap: break-word;
    word-break: break-all;
}

#theme-toggle-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

    #theme-toggle-btn:hover {
        background-color: #5a6268;
    }

body.dark-mode #theme-toggle-btn {
    background-color: #ff8c00; /* Orange accent */
}

    body.dark-mode #theme-toggle-btn:hover {
        background-color: #e07b00;
    }
