* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    min-height: 20px;
}

input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.projects-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.projects-list {
    margin-top: 20px;
}

.project {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.project:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.special-project {
    background-color: #fffde7;
    border-left: 4px solid #ffd600;
}

.special-project .project-content-preview {
    color: #5d4037;
    font-weight: bold;
}

.special-project:hover {
    transform: none !important;
    box-shadow: none !important;
}

.project-content-preview {
    white-space: pre-wrap;
    margin-bottom: 10px;
    cursor: pointer;
    max-height: 4.5em;           /* približno 3 vrstice */
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-date-preview {
    font-size: 12px;
    color: #95a5a6;
}

.delete-project-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.delete-project-btn:hover {
    background-color: #c0392b;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.plus-btn {
    background-color: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn {
    background-color: #2ecc71;
    color: white;
}

.cancel-btn {
    background-color: #e74c3c;
    color: white;
    margin-left: 10px;
}

.new-project-form {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.new-project-form textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px;
    margin-bottom: 15px;
    resize: vertical;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal:not(.hidden) {
    display: flex;
}

.fullscreen-btn,
.close-btn {
    position: fixed;
    top: 20px;
    background: white;
    border: 1px solid #ccc;
    padding: 6px 12px;
    font-size: 20px;
    cursor: pointer;
    z-index: 2000;
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

.fullscreen-btn {
    left: 20px;
}

.close-btn {
    right: 20px;
}

.fullscreen-btn:hover,
.close-btn:hover {
    background-color: #f0f0f0;
}

.modal-content {
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    width: 600px;
    margin: 50px auto;
    padding: 40px 20px 20px 20px; /* dodan padding-top, da gumbi niso na vsebini */
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    transition: width 0.3s ease, max-height 0.3s ease;
}

.modal-content.fullscreen {
    width: 95vw !important;
    max-height: 95vh !important;
    margin: 10px auto !important;
    border-radius: 4px !important;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    z-index: 10;
    background-color: white;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}


.close-btn:hover {
    color: #333;
}

.project-content-view {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: normal;
    text-align: left;
    padding: 20px 0;
    line-height: 1.6;
    width: 100%;
    font-size: 16px;
    font-family: inherit;
}

.project-date-view {
    color: #777;
    font-size: 14px;
    text-align: right;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .login-container, .projects-container {
        margin: 20px;
        padding: 20px;
    }
    
    .projects-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .plus-btn {
        margin-top: 15px;
    }
    
    .modal-content {
        width: 90%;
        padding: 20px;
    }
}

/* Improved text selection for highlighting */
::selection {
    background: #b3d4fc;
    color: #000;
}

/* Touch device improvements */
.project-content-view {
    user-select: text;
    -webkit-user-select: text;
}

/* Better modal for touch devices */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .project-content-view {
        font-size: 18px;
        line-height: 1.8;
    }
}

.modal-scrollable {
    overflow-y: auto;
    padding: 30px;
    height: 100%;
}

.project-paragraph {
    margin-bottom: 15px;
    white-space: normal;
}

#modalProjectContent > div {
    font-size: 14px;
    color: #555;
}

.highlighted {
    background-color: #b3d4fc;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
}

.highlight-item {
    display: inline-block;
    background: #f1f1f1;
    border-radius: 5px;
    padding: 2px 8px;
    margin: 2px;
    font-size: 14px;
    position: relative;
}

.highlight-item button.remove-word {
    border: none;
    background: transparent;
    color: #c00;
    margin-left: 6px;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.highlight-item button.remove-word:hover {
    color: #900;
}
