/* On-Call Study Tracker Styles */

/* Privacy Blur - activated when window loses focus */
body.privacy-blur .study-card-compact,
body.privacy-blur .stat-value,
body.privacy-blur .study-compact-name,
body.privacy-blur .privacy-banner,
body.privacy-blur .entry-form-section input,
body.privacy-blur .entry-form-section textarea,
body.privacy-blur .detail-value {
    filter: blur(10px);
    transition: filter 0.3s ease;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

body.privacy-blur::after {
    content: '🔒 Privacy Mode Active - Click window to view data';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 180, 150, 0.95);
    color: white;
    padding: 30px 50px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Privacy Banner */
.privacy-banner {
    background: linear-gradient(135deg, rgba(30, 180, 150, 0.15), rgba(31, 160, 122, 0.15));
    border: 1px solid var(--aquamarine);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    animation: slideDown 0.4s ease;
}

.privacy-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.privacy-icon {
    color: var(--aquamarine);
    flex-shrink: 0;
}

.privacy-text {
    flex: 1;
    color: var(--platinum);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.privacy-text strong {
    color: var(--aquamarine);
}

.privacy-info-btn {
    background: transparent;
    border: 1px solid rgba(30, 180, 150, 0.5);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--aquamarine);
    transition: all 0.3s ease;
    padding: 0;
}

.privacy-info-btn:hover {
    background: rgba(30, 180, 150, 0.1);
    transform: scale(1.1);
}

.privacy-banner-close {
    background: transparent;
    border: none;
    color: var(--platinum);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.privacy-banner-close:hover {
    opacity: 1;
    color: var(--aquamarine);
    transform: rotate(90deg);
}

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

/* Privacy Modal Sections */
.privacy-info-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--rich-black);
    border-radius: 8px;
    border-left: 3px solid var(--aquamarine);
}

.privacy-info-section h3 {
    color: var(--aquamarine);
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.privacy-info-section h3 svg {
    flex-shrink: 0;
}

.privacy-info-section p {
    color: var(--platinum);
    line-height: 1.6;
    margin: 0;
}

.privacy-info-section ul {
    color: var(--platinum);
    line-height: 1.8;
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.privacy-info-section li {
    margin-bottom: 8px;
}

.privacy-info-section.warning {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.privacy-info-section.warning h3 {
    color: #e74c3c;
}

/* Storage Info */
.storage-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--rich-black);
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 6px;
    color: var(--platinum);
    font-size: 0.9rem;
}

.storage-info svg {
    color: var(--aquamarine);
}

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--rich-black);
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--aquamarine);
    box-shadow: 0 4px 12px rgba(30, 180, 150, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--aquamarine);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--platinum);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Shift Controls */
.shift-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--jungle-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 180, 150, 0.3);
}

.btn-secondary {
    background: var(--rich-black);
    color: var(--platinum);
    border: 1px solid rgba(30, 180, 150, 0.5);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--aquamarine);
    color: var(--aquamarine);
}

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

.btn-danger:hover:not(:disabled) {
    background: #a93226;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Section */
.entry-form-section {
    background: var(--rich-black);
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.entry-form-section h2 {
    color: var(--aquamarine);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.study-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: var(--platinum);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 6px;
    background: var(--night);
    color: var(--platinum);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--aquamarine);
    box-shadow: 0 0 0 3px rgba(30, 180, 150, 0.1);
}

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 400;
}

.radio-group input[type="radio"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--aquamarine);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

#custom-study-type {
    display: none;
}

/* Controls Section */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 6px;
    background: var(--rich-black);
    color: var(--platinum);
    font-family: inherit;
    font-size: 0.95rem;
    min-width: 150px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--aquamarine);
}

.actions {
    display: flex;
    gap: 10px;
}

/* Studies Section */
.studies-section {
    margin-bottom: 40px;
}

.studies-section h2 {
    color: var(--aquamarine);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.studies-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(218, 227, 227, 0.6);
    font-size: 1.1rem;
}

/* Study Cards - Compact View */
.study-card-compact {
    background: var(--rich-black);
    border: 1px solid rgba(30, 180, 150, 0.3);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.study-card-compact:hover {
    border-color: var(--aquamarine);
    box-shadow: 0 2px 8px rgba(30, 180, 150, 0.15);
}

.study-card-compact.stat {
    border-left: 3px solid #e74c3c;
}

.study-card-compact.urgent {
    border-left: 3px solid var(--bronze);
}

.study-card-compact.routine {
    border-left: 3px solid var(--aquamarine);
}

.study-card-compact.approved {
    background: rgba(30, 180, 150, 0.05);
}

.study-card-compact.completed {
    background: rgba(46, 204, 113, 0.05);
    opacity: 0.8;
}

.study-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.study-compact-header:hover {
    background: rgba(30, 180, 150, 0.03);
}

.study-compact-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.expand-toggle {
    background: transparent;
    border: none;
    color: var(--platinum);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.expand-toggle[data-expanded="true"] svg {
    transform: rotate(90deg);
}

.study-compact-name {
    color: var(--platinum);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.study-compact-study {
    color: var(--aquamarine);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.study-compact-location {
    color: rgba(218, 227, 227, 0.7);
    font-size: 0.9rem;
}

.study-compact-separator {
    color: rgba(218, 227, 227, 0.3);
    margin: 0 4px;
}

.urgency-badge-small {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.urgency-badge-small.stat {
    background: #e74c3c;
    color: white;
}

.urgency-badge-small.urgent {
    background: var(--bronze);
    color: white;
}

.urgency-badge-small.routine {
    background: var(--aquamarine);
    color: white;
}

.study-compact-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.study-status-checks {
    display: flex;
    gap: 12px;
}

.status-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(218, 227, 227, 0.7);
}

.status-checkbox input[type="checkbox"] {
    accent-color: var(--aquamarine);
    cursor: pointer;
}

.checkbox-label {
    white-space: nowrap;
}

.delete-study-btn {
    background: transparent;
    border: none;
    color: rgba(218, 227, 227, 0.4);
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.delete-study-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

/* Expanded Details */
.study-expanded-details {
    border-top: 1px solid rgba(30, 180, 150, 0.2);
    padding: 15px;
    animation: slideDown 0.3s ease;
}

.study-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    color: rgba(218, 227, 227, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: var(--platinum);
    font-size: 0.95rem;
}

.additional-notes-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(30, 180, 150, 0.2);
}

.additional-notes-section h4 {
    color: var(--aquamarine);
    font-size: 0.9rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.additional-note {
    background: rgba(30, 180, 150, 0.05);
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 2px solid var(--aquamarine);
}

.note-timestamp {
    color: rgba(218, 227, 227, 0.5);
    font-size: 0.8rem;
    margin-right: 8px;
}

.note-text {
    color: var(--platinum);
    font-size: 0.9rem;
}

.study-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-add-note {
    background: transparent;
    border: 1px solid rgba(30, 180, 150, 0.5);
    color: var(--aquamarine);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-add-note:hover {
    background: rgba(30, 180, 150, 0.1);
    border-color: var(--aquamarine);
}

.detail-row .value {
    color: var(--platinum);
    flex: 1;
}

.study-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(30, 180, 150, 0.2);
}

.timestamp {
    color: rgba(218, 227, 227, 0.5);
    font-size: 0.85rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--night);
    border: 1px solid var(--aquamarine);
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(30, 180, 150, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--aquamarine);
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--platinum);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--aquamarine);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(30, 180, 150, 0.3);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Handoff Report */
.handoff-report {
    color: var(--platinum);
}

.handoff-report h3 {
    color: var(--aquamarine);
    margin-bottom: 15px;
}

.handoff-report h4 {
    color: var(--bronze);
    margin-top: 25px;
    margin-bottom: 15px;
}

.handoff-report hr {
    border: none;
    border-top: 1px solid rgba(30, 180, 150, 0.3);
    margin: 20px 0;
}

.handoff-studies {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.handoff-study-item {
    background: var(--rich-black);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--aquamarine);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(30, 180, 150, 0.5);
    border-radius: 6px;
    padding: 8px;
    color: var(--platinum);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--aquamarine);
    color: var(--aquamarine);
}

/* Light Theme */
body[data-theme="light"] {
    background: #f5f5f5;
    color: #333;
}

body[data-theme="light"] .stat-card,
body[data-theme="light"] .entry-form-section,
body[data-theme="light"] .study-card,
body[data-theme="light"] .search-input,
body[data-theme="light"] .filter-select,
body[data-theme="light"] .btn-secondary {
    background: white;
    color: #333;
}

body[data-theme="light"] .form-group input,
body[data-theme="light"] .form-group select,
body[data-theme="light"] .form-group textarea {
    background: white;
    color: #333;
}

body[data-theme="light"] .modal-content {
    background: white;
}

body[data-theme="light"] .handoff-study-item {
    background: #f5f5f5;
}

body[data-theme="light"] .detail-row .label,
body[data-theme="light"] .timestamp,
body[data-theme="light"] .empty-state {
    color: rgba(0, 0, 0, 0.6);
}

body[data-theme="light"] .detail-row .value,
body[data-theme="light"] .form-group label {
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    /* Privacy Banner Mobile */
    .privacy-banner {
        padding: 12px 15px;
    }

    .privacy-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .privacy-text {
        font-size: 0.9rem;
    }

    .privacy-banner-close {
        align-self: flex-end;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .privacy-info-section {
        padding: 15px;
    }

    .storage-info {
        width: 100%;
        justify-content: center;
    }

    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .shift-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .entry-form-section {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }

    /* Compact Study Cards Mobile */
    .study-compact-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    .study-compact-left {
        flex-wrap: wrap;
        gap: 8px;
    }

    .study-compact-name,
    .study-compact-study {
        font-size: 0.9rem;
    }

    .study-compact-separator {
        display: none;
    }

    .study-compact-right {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .study-status-checks {
        flex-direction: column;
        gap: 8px;
    }

    .status-checkbox {
        font-size: 0.8rem;
    }

    .study-details-grid {
        grid-template-columns: 1fr;
    }

    .study-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .detail-row .label {
        min-width: auto;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-dashboard {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .study-card {
        padding: 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* Header Styles */
header {
    background: var(--night);
    border-bottom: 1px solid rgba(30, 180, 150, 0.3);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--aquamarine);
    margin: 0;
    font-size: 1.8rem;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

body[data-theme="light"] header {
    background: white;
    border-bottom-color: rgba(30, 180, 150, 0.5);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .logo {
        height: 35px;
    }
}
