/* Portfolio System Styles */

/* Portfolio Modal */
.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.portfolio-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.portfolio-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.portfolio-modal-close:hover {
    color: #1e40af;
}

.portfolio-modal-content h2 {
    color: #1e40af;
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    color: #1e40af;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: rgba(239, 246, 255, 0.8);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(219, 234, 254, 1);
    border-color: rgba(59, 130, 246, 0.5);
    color: #1e40af;
}

/* Portfolio Items */
#portfolio-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.portfolio-item {
    background: rgba(239, 246, 255, 0.8);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.portfolio-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.portfolio-item-header h3 {
    color: #1e40af;
    font-size: 1.25rem;
    margin: 0;
    flex: 1;
    font-weight: 700;
}

.portfolio-item-actions {
    display: flex;
    gap: 0.5rem;
}

.portfolio-item-actions button {
    background: transparent;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: #64748b;
}

.portfolio-item-actions button:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    color: #1e40af;
}

.portfolio-item-type {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.portfolio-item-description {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.portfolio-item-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-block;
    width: fit-content;
}

.portfolio-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
    transform: translateX(3px);
}

.portfolio-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-tag {
    background: rgba(147, 51, 234, 0.1);
    color: #6b21a8;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.portfolio-item-date {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.portfolio-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.portfolio-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border: 2px solid rgba(16, 185, 129, 0.5);
}

.notification-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: 2px solid rgba(239, 68, 68, 0.5);
}

.notification-info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border: 2px solid rgba(59, 130, 246, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    #portfolio-items-container {
        grid-template-columns: 1fr;
    }

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

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

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }
}

/* Dark Mode */
body.dark-mode .portfolio-modal-content {
    background: rgba(15, 15, 26, 0.95);
    border-color: rgba(96, 165, 250, 0.4);
}

body.dark-mode .portfolio-modal-content h2 {
    color: #60a5fa;
}

body.dark-mode .form-group label {
    color: #60a5fa;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background: rgba(30, 58, 138, 0.3);
    border-color: rgba(96, 165, 250, 0.4);
    color: #e0e7ff;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.6);
    color: #93c5fd;
}

body.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(59, 130, 246, 0.25));
    border-color: rgba(96, 165, 250, 0.9);
}

body.dark-mode .btn-secondary {
    background: rgba(30, 58, 138, 0.3);
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
}

body.dark-mode .btn-secondary:hover {
    background: rgba(30, 58, 138, 0.5);
    border-color: rgba(96, 165, 250, 0.7);
    color: #bfdbfe;
}

body.dark-mode .portfolio-item {
    background: rgba(30, 58, 138, 0.3);
    border-color: rgba(96, 165, 250, 0.4);
}

body.dark-mode .portfolio-item:hover {
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.3);
}

body.dark-mode .portfolio-item-header h3 {
    color: #60a5fa;
}

body.dark-mode .portfolio-item-actions button {
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
}

body.dark-mode .portfolio-item-actions button:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.7);
    color: #bfdbfe;
}

body.dark-mode .portfolio-item-type {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.2);
}

body.dark-mode .portfolio-item-description {
    color: #c7d2fe;
}

body.dark-mode .portfolio-link {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.2);
}

body.dark-mode .portfolio-link:hover {
    background: rgba(96, 165, 250, 0.3);
    color: #bfdbfe;
}

body.dark-mode .portfolio-tag {
    background: rgba(147, 51, 234, 0.2);
    color: #a78bfa;
    border-color: rgba(147, 51, 234, 0.4);
}

body.dark-mode .portfolio-item-date {
    color: #94a3b8;
    border-top-color: rgba(96, 165, 250, 0.3);
}

body.dark-mode .portfolio-empty {
    color: #94a3b8;
}

body.dark-mode .portfolio-modal-close {
    color: #93c5fd;
}

body.dark-mode .portfolio-modal-close:hover {
    color: #bfdbfe;
}

/* Tinkercad 3D Viewer Styles */
.tinkercad-viewer-container,
.portfolio-item .tinkercad-viewer-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(16, 185, 129, 0.25);
    background: rgba(0, 0, 0, 0.05);
    margin: 0.75rem 0;
    position: relative;
}

.tinkercad-viewer-container iframe,
.portfolio-item iframe[src*="tinkercad.com/embed"] {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.tinkercad-viewer-hint {
    padding: 0.5rem;
    text-align: center;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-size: 0.85rem;
    font-weight: 600;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
}

/* Responsive Tinkercad viewers */
@media (max-width: 768px) {
    .tinkercad-viewer-container,
    .portfolio-item .tinkercad-viewer-container {
        height: 300px;
    }
}

/* Dark mode for Tinkercad viewers */
body.dark-mode .tinkercad-viewer-container,
body.dark-mode .portfolio-item .tinkercad-viewer-container {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .tinkercad-viewer-hint {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-top-color: rgba(16, 185, 129, 0.3);
}


