/* style.css - Professional Enhanced Version */
:root {
    --primary: #4a6fa5;
    --primary-light: #6b8cbc;
    --secondary: #5d8aa8;
    --accent: #ff9f43;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    color: var(--accent);
}

.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
    min-height: 44px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #4a7a9a;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #e02d3b;
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: #ff8c2b;
    transform: translateY(-2px);
}

.main-content {
    display: flex;
    gap: 20px;
    flex-direction: row;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 320px;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.note-list {
    flex: 1;
    overflow-y: auto;
    margin: 15px 0;
    max-height: 300px;
    -webkit-overflow-scrolling: touch;
}

.note-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    background: var(--light);
    position: relative;
    min-height: 60px;
}

.note-item:hover {
    transform: translateX(5px);
    background: #e9ecef;
}

.note-item.active {
    background: rgba(74, 111, 165, 0.1);
    border-left-color: var(--accent);
}

.note-item.low {
    border-left-color: var(--success);
}

.note-item.medium {
    border-left-color: var(--warning);
}

.note-item.high {
    border-left-color: var(--danger);
}

.note-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.note-preview {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-note {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px;
    border-radius: 3px;
    font-size: 12px;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-note:hover {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 10px;
}

.note-title-input {
    flex: 1;
    font-size: clamp(16px, 3vw, 20px);
    font-weight: bold;
    border: none;
    outline: none;
    background: transparent;
    color: var(--dark);
    min-width: 150px;
    padding: 8px 0;
}

.note-title-input::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.importance-selector {
    display: flex;
    gap: 10px;
}

.importance-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.importance-btn.low {
    background-color: var(--success);
}

.importance-btn.medium {
    background-color: var(--warning);
}

.importance-btn.high {
    background-color: var(--danger);
}

.importance-btn.active {
    border-color: var(--dark);
    transform: scale(1.1);
}

.note-editor {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.toolbar button {
    padding: 8px 12px;
    font-size: 13px;
    flex-grow: 1;
    justify-content: center;
    min-width: 0;
    min-height: 40px;
}

.editor {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--dark);
    font-size: 16px;
    line-height: 1.6;
    min-height: 200px;
    font-family: inherit;
}

.editor::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.bible-quote {
    background: #f8f9fa;
    border-left: 4px solid var(--accent);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    position: relative;
    line-height: 1.6;
}

.bible-quote .reference {
    display: block;
    text-align: right;
    font-size: 14px;
    color: var(--secondary);
    margin-top: 8px;
    font-style: normal;
    font-weight: 600;
}

.delete-scripture {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px;
    border-radius: 3px;
    font-size: 12px;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-scripture:hover {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.bible-search {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.bible-search h4 {
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bible-search input, .bible-search select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    font-size: 16px;
    background: white;
    transition: var(--transition);
}

.bible-search input:focus, .bible-search select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.bible-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
}

.bible-verse {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid var(--secondary);
}

.bible-verse:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.offline-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: #333;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scripture-count {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

.bible-version-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.bible-version-selector select {
    flex: 1;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: none;
    max-width: calc(100vw - 40px);
    word-wrap: break-word;
    font-weight: 500;
}

/* Study Tools Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.modal-title {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark);
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background: #f8f9fa;
}

.study-tools-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.study-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 14px;
    min-height: 44px;
}

.study-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.study-tab-content {
    display: none;
}

.study-tab-content.active {
    display: block;
}

.study-tab-content h3 {
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.study-tab-content p {
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.word-study-results, .cross-reference-results, .commentary-results {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    -webkit-overflow-scrolling: touch;
}

.word-study-item, .cross-ref-item, .commentary-item {
    padding: 15px;
    margin-bottom: 12px;
    background: white;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow);
}

.word-study-item h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 18px;
}

.original-language {
    font-style: italic;
    color: var(--secondary);
    margin: 8px 0;
    padding: 8px;
    background: rgba(93, 138, 168, 0.1);
    border-radius: 4px;
}

.strongs-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    font-weight: bold;
}

.reading-plan {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.reading-day {
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent;
}

.reading-day:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
}

.reading-day.completed {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.prayer-list {
    margin-top: 15px;
}

.prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 12px;
    transition: var(--transition);
}

.prayer-item:hover {
    background: #e9ecef;
}

.prayer-actions {
    display: flex;
    gap: 8px;
}

.prayer-actions button {
    min-height: 40px;
    min-width: 40px;
    padding: 8px;
}

.highlight-yellow {
    background-color: #fff3cd;
}

.highlight-blue {
    background-color: #d1ecf1;
}

.highlight-green {
    background-color: #d4edda;
}

.highlight-pink {
    background-color: #f8d7da;
}

/* Form elements in study tools */
.study-tab-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.study-tab-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.study-tab-content select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 16px;
    background: white;
    margin-bottom: 15px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .container {
        padding: 10px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .editor-container {
        order: 1;
    }
    
    .note-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .importance-selector {
        align-self: flex-end;
    }
    
    .toolbar {
        justify-content: center;
    }
    
    .toolbar button {
        flex-basis: calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-height: 44px;
    }
    
    .reading-plan {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        justify-content: center;
        width: 100%;
    }
    
    .controls button {
        flex-grow: 1;
        justify-content: center;
        max-width: calc(33.333% - 8px);
        min-height: 44px;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .logo {
        justify-content: center;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .study-tools-tabs {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .toolbar button {
        flex-basis: 100%;
        max-width: 100%;
    }
    
    .controls button {
        max-width: calc(50% - 6px);
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .reading-plan {
        grid-template-columns: 1fr;
    }
    
    .bible-version-selector {
        flex-direction: column;
    }
    
    .prayer-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .prayer-actions {
        align-self: flex-end;
    }
    
    .study-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .note-item {
        padding: 10px;
    }
    
    .bible-quote {
        padding: 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    button, .note-item, .reading-day, .study-tab {
        min-height: 44px;
    }
    
    .delete-note, .delete-scripture {
        min-height: 36px;
        min-width: 36px;
    }
    
    .note-item:hover {
        transform: none;
    }
    
    .reading-day:hover {
        transform: none;
    }
    
    button:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .controls, .toolbar, .sidebar, .offline-indicator, .notification, .modal {
        display: none !important;
    }
    
    .main-content {
        display: block;
    }
    
    .editor-container {
        box-shadow: none;
        background: white;
        border: 1px solid #ddd;
    }
    
    .note-editor {
        box-shadow: none;
    }
    
    body {
        background: white;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}