/* Custom styles for Roladex Vue+Vuetify mobile-friendly application */

/* Network node icons */
.network-node-icon {
    font-family: 'Material Design Icons', Arial, sans-serif;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    fill: white;
}

/* Define network node icon character codes */
.network-icon-person:before {
    content: "\F004";
}

.network-icon-organization:before {
    content: "\F0F7";
}

/* General styles */
html, body {
    font-family: 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme transition effects */
.v-application {
    transition: background-color 0.3s ease;
}

.v-card,
.v-app-bar,
.v-navigation-drawer,
.v-footer,
.v-btn,
.v-list,
.v-list-item,
.v-data-table,
.v-text-field,
.v-dialog,
.v-text-field,
.v-select,
.v-input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Smooth icon transition */
.v-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle-btn {
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    transform: scale(0) translate(-50%, -50%);
    transform-origin: top left;
    border-radius: 50%;
    transition: transform 0.5s;
}

.theme-toggle-btn:active::after {
    transform: scale(3) translate(-50%, -50%);
}

.theme-toggle-icon {
    transform: rotate(0deg);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-toggle-icon--dark {
    transform: rotate(180deg);
}

/* Dark theme overrides */
[data-theme="dark"] .v-card__title {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .v-data-table th {
    color: rgba(255, 255, 255, 0.87) !important;
}

[data-theme="dark"] h2 {
    color: rgba(255, 255, 255, 0.87);
}

[data-theme="dark"] .v-field__outline__notch {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .v-btn:focus, 
[data-theme="dark"] .v-field:focus-within {
    outline: 2px solid rgba(41, 128, 185, 0.5);
}

/* Custom dialog background color in dark mode */
[data-theme="dark"] .v-dialog {
    background-color: #1e1e1e;
}

/* Semi-transparent backdrop for modals */
.v-overlay__scrim {
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(3px);
}

/* Better contrast for dark mode inputs */
[data-theme="dark"] .v-field__input {
    color: rgba(255, 255, 255, 0.9);
}

/* Better contrast for selected items in dark mode */
[data-theme="dark"] .v-data-table .v-data-table__selected {
    background-color: rgba(41, 128, 185, 0.2) !important;
}

/* Network Graph Styles */
.network-graph-container {
    position: relative;
    overflow: hidden;
}

.network-node {
    cursor: pointer;
    transition: transform 0.3s ease, stroke-width 0.3s ease;
    stroke-width: 1.5px;
    stroke: rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.2));
}

.network-node:hover {
    transform: scale(1.15);
    stroke-width: 2.5px;
    filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.3));
}

.network-node.individual {
    fill: #3498db; /* Bright blue */
}

.network-node.organization {
    fill: #e74c3c; /* Red-orange */
}

.network-edge {
    stroke-width: 3px;
    stroke-opacity: 0.8;
    transition: stroke-width 0.3s ease, stroke-opacity 0.3s ease;
    stroke-dasharray: none;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));
}

.network-edge:hover {
    stroke-width: 5px;
    stroke-opacity: 1;
}

.network-label {
    font-size: 13px;
    pointer-events: none;
    fill: rgba(0, 0, 0, 0.9);
    text-anchor: middle;
    dominant-baseline: middle;
    font-weight: 600;
    letter-spacing: 0.02em;
    filter: drop-shadow(0px 1px 2px rgba(255, 255, 255, 0.9));
    text-shadow: 0 0 3px white, 0 0 3px white, 0 0 3px white;
}

.network-edge-label-bg {
    fill: rgba(255, 255, 255, 0.95);
    rx: 4;
    ry: 4;
    stroke: #2980b9;
    stroke-width: 0.8;
    filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.15));
}

.network-edge-label {
    font-size: 11px;
    pointer-events: none;
    fill: rgba(0, 0, 0, 0.95);
    text-anchor: middle;
    dominant-baseline: middle;
    font-weight: 600;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .network-label {
    fill: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.9));
    text-shadow: 0 0 3px black, 0 0 3px black, 0 0 3px black;
    font-weight: 600;
}

[data-theme="dark"] .network-edge-label {
    fill: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .network-edge-label-bg {
    fill: rgba(30, 30, 30, 0.95);
    stroke: #3498db;
    stroke-width: 0.5;
}

[data-theme="dark"] .network-edge {
    stroke: #3498db; /* Brighter blue for dark mode */
}

/* Zoom controls for dark mode */
[data-theme="dark"] .zoom-controls button {
    background-color: #1e1e1e !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.network-node-icon {
    font-family: 'Material Design Icons';
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .network-node {
    stroke: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .network-node.individual {
    fill: #3498db; /* Bright blue */
}

[data-theme="dark"] .network-node.organization {
    fill: #e74c3c; /* Red-orange */
}

.network-tooltip {
    position: absolute;
    background-color: rgba(22, 30, 40, 0.9);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
}

.network-tooltip.show {
    opacity: 1;
    transform: translateY(-5px);
}

.connection-line {
    display: inline-block;
    height: 2.5px;
    width: 40px;
    background-color: #2980b9;
    opacity: 0.8;
}

/* Prevent zoom on input focus for mobile */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Override some Vuetify styles */
h2 {
    font-weight: 500;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.v-data-table th {
    font-weight: 500 !important;
}

/* Layout */
.v-main {
    min-height: calc(100vh - 128px); /* Account for app bar and footer */
}

/* For mobile devices with bottom navigation */
@media (max-width: 959px) {
    .v-main {
        min-height: calc(100vh - 56px - 56px); /* Account for app bar and bottom navigation */
        padding-bottom: 64px;
    }
}

/* Card style overrides */
.v-card {
    border-radius: 8px;
}

.v-card__title {
    font-size: 1.25rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Fix for Safari button height */
.v-btn {
    line-height: normal;
}

/* Navigation drawer */
.v-navigation-drawer {
    z-index: 999;
}

/* Bottom navigation */
.v-bottom-navigation {
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Dialog responsiveness */
@media (max-width: 599px) {
    .v-dialog:not(.v-dialog--fullscreen) {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* Data table responsiveness - use with care because Vuetify handles much of this */
@media (max-width: 599px) {
    .v-data-table__wrapper {
        overflow-x: auto;
    }
    
    /* If needed, we can hide specific columns on mobile */
    /* But this is handled in Vue component properties */
}

/* Custom classes for mobile optimization */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-only {
    display: none;
}

@media (max-width: 959px) {
    .mobile-only {
        display: initial;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Density adjustments for mobile inputs */
.v-text-field--density-comfortable .v-field__input {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Spacing adjustments for mobile */
@media (max-width: 599px) {
    .v-container {
        padding: 12px !important;
    }
    
    .v-card-text {
        padding: 16px !important;
    }
}

/* Focus styles for better accessibility */
.v-btn:focus, 
.v-field:focus-within {
    outline: 2px solid rgba(52, 152, 219, 0.5);
    outline-offset: 2px;
}

/* Touch-friendly sizing for interactive elements */
@media (max-width: 768px) {
    .v-btn {
        min-height: 44px;
    }
    
    .v-list-item {
        min-height: 48px;
    }
}

/* Fix for Safari overflow issues */
.v-application {
    overflow-x: hidden;
}

/* Screen reader only content (accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Input validation styling */
.v-field.valid .v-field__outline {
    color: var(--v-success-base, #2ecc71) !important;
}

.v-field.error .v-field__outline {
    color: var(--v-error-base, #e74c3c) !important;
}

.format-helper {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 4px;
    font-style: italic;
}

[data-theme="dark"] .format-helper {
    color: rgba(255, 255, 255, 0.6);
}

/* Contact value styling for lazy loading */
.contact-value-wrapper {
    position: relative;
}

.contact-value-wrapper div {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    display: inline-block;
}

/* Inline editing styles */
.contact-value-wrapper .edit-mode {
    background-color: rgba(41, 128, 185, 0.1);
    border: 1px solid rgba(41, 128, 185, 0.5);
    padding: 4px 8px;
}

[data-theme="dark"] .contact-value-wrapper .edit-mode {
    background-color: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.7);
}

.inline-edit-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.inline-edit-input {
    flex: 1;
    min-width: 120px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    font-size: 14px;
}

[data-theme="dark"] .inline-edit-input {
    background-color: rgba(30, 30, 30, 0.9);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.inline-edit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background-color: rgba(46, 204, 113, 0.2);
    color: #27ae60;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-edit-button:hover {
    background-color: rgba(46, 204, 113, 0.3);
}

.inline-edit-button.cancel {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.inline-edit-button.cancel:hover {
    background-color: rgba(231, 76, 60, 0.3);
}

.contact-value-wrapper div span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    display: inline-block;
}

@media (max-width: 600px) {
    .contact-value-wrapper div span {
        max-width: 180px;
    }
}