/* DOTJAM - Global Styles */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Hammer Mode */
.hammer-mode-active {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><text y="20" font-size="20">🔨</text></svg>') 16 16, pointer !important;
}

.hammer-mode-active .workspace-item {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><text y="20" font-size="20">🔨</text></svg>') 16 16, pointer !important;
}

/* Delete Animations */
@keyframes hammerHit {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(0.95) rotate(-5deg); }
    50% { transform: scale(1.05) rotate(5deg); }
    75% { transform: scale(0.9) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-10px) rotate(-5deg); }
    20% { transform: translateX(10px) rotate(5deg); }
    30% { transform: translateX(-10px) rotate(-5deg); }
    40% { transform: translateX(10px) rotate(5deg); }
    50% { transform: translateX(-5px) rotate(-3deg); }
    60% { transform: translateX(5px) rotate(3deg); }
    70% { transform: translateX(-5px) rotate(-3deg); }
    80% { transform: translateX(5px) rotate(3deg); }
    90% { transform: translateX(0) rotate(0deg); }
}

@keyframes fall {
    0% { 
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(200px) rotate(180deg);
        opacity: 0.5;
    }
    100% { 
        transform: translateY(400px) rotate(360deg);
        opacity: 0;
    }
}

.deleting-item {
    pointer-events: none;
    z-index: 9999;
}

.hammer-hitting {
    animation: hammerHit 0.3s ease-out;
}

.item-shaking {
    animation: shake 0.5s ease-in-out;
}

.item-falling {
    animation: fall 0.8s ease-in forwards;
}

/* Glass Breaking Confirmation */
.glass-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(173, 216, 230, 0.3), rgba(135, 206, 235, 0.3));
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><text y="20" font-size="20">🔨</text></svg>') 16 16, pointer;
}

.glass-panel {
    width: 400px;
    height: 300px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.8));
    border: 3px solid rgba(100, 149, 237, 0.6);
    border-radius: 10px;
    box-shadow: 
        0 0 30px rgba(135, 206, 235, 0.5),
        inset 0 0 50px rgba(255, 255, 255, 0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.glass-panel:hover {
    transform: scale(1.02);
    box-shadow: 
        0 0 40px rgba(135, 206, 235, 0.7),
        inset 0 0 60px rgba(255, 255, 255, 0.6);
}

@keyframes crackGlass {
    0% { 
        filter: brightness(1);
        transform: scale(1);
    }
    20% { 
        filter: brightness(1.5);
        transform: scale(0.98);
    }
    40% { 
        filter: brightness(0.8);
        transform: scale(1.02) rotate(2deg);
    }
    60% { 
        filter: brightness(1.2);
        transform: scale(0.96) rotate(-2deg);
    }
    80% { 
        filter: brightness(0.6);
        transform: scale(1.04) rotate(1deg);
    }
    100% { 
        filter: brightness(1);
        transform: scale(1) rotate(0deg);
    }
}

@keyframes shatter {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.glass-cracking {
    animation: crackGlass 0.3s ease-out;
}

.glass-shattering {
    animation: shatter 0.5s ease-out forwards;
}

.crack-line {
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
    transform-origin: center;
    pointer-events: none;
}

/* Sad Eyes Animation */
.sad-eyes-overlay {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    z-index: 10;
    pointer-events: none;
    animation: floatEyes 2s ease-in-out infinite;
}

@keyframes floatEyes {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes blinkSad {
    0%, 45%, 55%, 100% { content: '😢'; }
    50% { content: '😞'; }
}

.sad-eyes-overlay::before {
    content: '😢';
    animation: blinkSad 3s ease-in-out infinite;
}

.sad-eyes-overlay.laughing {
    animation: laughBounce 1s ease-out forwards;
}

.sad-eyes-overlay.laughing::before {
    content: '😂';
    animation: none;
}

@keyframes laughBounce {
    0% { 
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateX(-50%) scale(1.3);
    }
    40% {
        transform: translateX(-50%) scale(1.2) rotate(-10deg);
    }
    60% {
        transform: translateX(-50%) scale(1.3) rotate(10deg);
    }
    80% {
        transform: translateX(-50%) scale(1.5) translateY(-20px);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(2) translateY(-80px);
        opacity: 0;
    }
}

@keyframes waveGoodbye {
    0% { 
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    15% { transform: translateX(20px) rotate(10deg); }
    30% { transform: translateX(-15px) rotate(-8deg); }
    45% { transform: translateX(15px) rotate(8deg); }
    60% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
    85% { 
        transform: translateX(0) rotate(0deg) scale(0.8);
        opacity: 0.6;
    }
    100% { 
        transform: translateY(150px) scale(0.3);
        opacity: 0;
    }
}

.waving-goodbye {
    animation: waveGoodbye 2s ease-in-out forwards;
    position: relative;
}

.waving-goodbye::after {
    content: '👋';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 48px;
    animation: handWave 0.6s ease-in-out infinite;
    z-index: 100;
}

@keyframes handWave {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(30deg); }
}

/* Custom Delete Confirmation Modal */
.delete-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.delete-confirm-panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.delete-confirm-panel h3 {
    color: #333;
    margin-bottom: 15px;
}

.delete-confirm-panel p {
    color: #666;
    margin-bottom: 25px;
}

.delete-confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.delete-confirm-buttons button {
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-confirm-buttons .btn-cancel {
    background: #6c757d;
    color: white;
}

.delete-confirm-buttons .btn-cancel:hover {
    background: #5a6268;
    transform: scale(1.05);
}

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

.delete-confirm-buttons .btn-confirm:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* Dashboard */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 30px;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding: 20px;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-color);
    color: white;
}

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 60px);
}

/* Workspace Canvas */
.workspace-canvas {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-size: 20px 20px;
    background-image: 
        linear-gradient(to right, #f0f0f0 1px, transparent 1px),
        linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
}

.workspace-canvas.pattern-dots {
    background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

.workspace-canvas.pattern-grid {
    background-image: 
        linear-gradient(to right, #e0e0e0 1px, transparent 1px),
        linear-gradient(to bottom, #e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

/* Workspace Item */
.workspace-item {
    position: absolute;
    width: 120px;
    padding: 15px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: move;
    user-select: none;
    transition: box-shadow 0.3s;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.workspace-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.workspace-item.dragging {
    opacity: 0.7;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 9999;
}

.workspace-item[data-item-type="folder"].drop-target {
    background-color: #e3f2fd !important;
    border: 2px dashed #2196F3 !important;
    transform: scale(1.05);
}

.workspace-item .item-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
    position: relative;
}

.folder-item-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.workspace-item .item-name {
    font-size: 12px;
    text-align: center;
    word-wrap: break-word;
    color: #333;
}

.workspace-item .item-owner {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    background-size: cover;
    background-position: center;
}

.workspace-item.starred::before {
    content: '⭐';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
}

/* Folder */
.workspace-item.folder .item-icon {
    color: #f39c12;
}

/* Bootstrap Modal Override - Let Bootstrap handle modals */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }

/* Workspace User Avatars */
.user-avatar-mini {
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-avatar-mini:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.workspace-users-preview {
    animation: fadeInUsers 0.3s ease;
}

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