/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Screen Management */
.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

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

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.logo h1 {
    color: #333;
    margin-bottom: 5px;
    font-size: 2rem;
}

.logo p {
    color: #666;
    font-size: 1rem;
}

/* Dashboard */
#dashboardScreen {
    background: #f8fafc;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left i {
    font-size: 1.5rem;
    color: #667eea;
}

.header-left h1 {
    color: #333;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.nav-tab {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: #334155;
    background: #f1f5f9;
}

.nav-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #eff6ff;
}

.nav-tab i {
    margin-right: 0.5rem;
}

/* Actions Bar */
.actions-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Tasks Section */
.tasks-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h2 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.task-duration {
    color: #666;
    font-size: 0.9rem;
}

.task-actions {
    display: flex;
    gap: 5px;
}

.task-actions button {
    padding: 8px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-actions .btn-edit {
    color: #3b82f6;
}

.task-actions .btn-edit:hover {
    background: #3b82f6;
    color: white;
}

.task-actions .btn-delete {
    color: #ef4444;
}

.task-actions .btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Switch */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.close-btn:hover {
    background: #f1f5f9;
}

.modal form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    text-align: center;
    color: #667eea;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    transform: translateX(400px);
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .actions-bar {
        flex-direction: column;
    }
    
    .task-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .routines-grid {
        grid-template-columns: 1fr;
    }
    
    .icon-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Routines Section */
.routines-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.routines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.routine-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.routine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.routine-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.routine-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--routine-color, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.routine-info h3 {
    color: #1e293b;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.routine-info p {
    color: #64748b;
    font-size: 0.9rem;
}

.routine-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    gap: 0.5rem;
}

.routine-stat {
    text-align: center;
}

.routine-stat strong {
    display: block;
    color: #1e293b;
    font-size: 1.25rem;
}

.routine-stat span {
    color: #64748b;
    font-size: 0.8rem;
}

.routine-stat .end-time {
    color: #059669;
    font-weight: bold;
}

.routine-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.routine-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.routine-btn.start {
    background: #10b981;
    color: white;
}

.routine-btn.edit {
    background: #f59e0b;
    color: white;
}

.routine-btn.delete {
    background: #ef4444;
    color: white;
}

.routine-btn:hover {
    transform: scale(1.05);
}

.routine-tasks {
    border-top: 1px solid #e2e8f0;
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

/* Task management within routines */
.routine-tasks-list {
    margin-top: 0.5rem;
}

.routine-task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.routine-task-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.routine-task-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.task-drag-handle {
    cursor: grab;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.task-drag-handle:hover {
    background: #e2e8f0;
}

.task-drag-handle:active {
    cursor: grabbing;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-name {
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
}

.task-name:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.task-duration {
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
}

.task-duration:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
}

/* Drag and drop visual feedback */
.routine-tasks-list.drag-over {
    background: #eff6ff;
    border: 2px dashed #3b82f6;
    border-radius: 6px;
}

.drop-indicator {
    height: 2px;
    background: #3b82f6;
    margin: 0.25rem 0;
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drop-indicator.active {
    opacity: 1;
}

/* Color and Icon Pickers */
.color-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.color-option:hover,
.color-option.active {
    border-color: #1e293b;
    transform: scale(1.1);
}

.icon-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.icon-options {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    color: #64748b;
}

.icon-option:hover,
.icon-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

/* Duration Input Components */
.duration-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.duration-input-group input {
    flex: 1;
    min-width: 80px;
}

.duration-unit-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 100px;
}

.duration-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.duration-preset {
    padding: 0.4rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.duration-preset:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

.duration-preset.active {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}
/* Google Sign-In Button */
.btn-google {
    background: white;
    color: #444;
    border: 1px solid #ddd;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-google i {
    margin-right: 12px;
    color: #4285f4;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.error-message {
    margin-top: 16px;
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 14px;
    text-align: center;
}

.error-message.hidden {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.user-photo.hidden {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #666;
}

.empty-state p {
    font-size: 16px;
}

.routine-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.routine-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.routine-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.routine-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.routine-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.routine-stats {
    display: flex;
    gap: 20px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.routine-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.routine-stat i {
    color: #999;
}

.routines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    transition: bottom 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    bottom: 24px;
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

/* Routine Details Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.routine-details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.routine-details-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    font-size: 28px;
    flex-shrink: 0;
}

.routine-details-title {
    flex: 1;
}

.routine-details-title h3 {
    color: #1e293b;
    font-size: 24px;
    margin: 0 0 4px 0;
}

.routine-details-title p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #1e293b;
}

.routine-details-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 0;
    padding: 24px;
    background: #f8fafc;
}

.routine-detail-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}

.routine-detail-stat i {
    font-size: 24px;
    color: #3b82f6;
}

.routine-detail-stat strong {
    display: block;
    font-size: 20px;
    color: #1e293b;
}

.routine-detail-stat span {
    display: block;
    font-size: 13px;
    color: #64748b;
}

.routine-details-tasks {
    padding: 24px;
}

.routine-details-tasks h4 {
    color: #1e293b;
    font-size: 18px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.routine-tasks-list-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
}

.routine-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.routine-task-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.task-order {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.task-content {
    flex: 1;
}

.task-name {
    color: #1e293b;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
}

.task-duration {
    color: #64748b;
    font-size: 14px;
}

/* Form Elements */
.modal-body {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

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

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover,
.color-option.active {
    border-color: #1e293b;
    transform: scale(1.1);
}

/* Icon Picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #64748b;
    transition: all 0.2s;
}

.icon-option:hover,
.icon-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #10b981;
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: white;
    color: #64748b;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Routine Details Actions */
.routine-details-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

/* Task Actions */
.task-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-icon {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.btn-icon.btn-danger {
    color: #ef4444;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Drag and Drop */
.task-drag-handle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: grab;
    flex-shrink: 0;
}

.task-drag-handle:active {
    cursor: grabbing;
}

.routine-task-item {
    transition: all 0.2s;
}

.routine-task-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.routine-task-item:hover .task-drag-handle {
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .routine-details-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .routine-task-item {
        flex-wrap: wrap;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .icon-picker {
        grid-template-columns: repeat(4, 1fr);
    }

    .routine-details-actions {
        flex-direction: column;
    }

    .routine-details-actions .btn {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

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

/* Clickable elements in routine details */
#routineDetailsName {
    cursor: pointer;
    transition: color 0.2s ease;
}

#routineDetailsName:hover {
    color: #3B82F6;
}

#routineDetailsIcon {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#routineDetailsIcon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Icon and Color Picker Overlay */
.icon-color-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.icon-color-picker-modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.icon-color-picker-modal h4 {
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: 1.25rem;
}

.picker-section {
    margin-bottom: 1.5rem;
}

.picker-section:last-child {
    margin-bottom: 0;
}

.picker-section label {
    display: block;
    margin-bottom: 0.75rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.icon-color-picker-modal .icon-options {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.icon-color-picker-modal .icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    color: #64748b;
}

.icon-color-picker-modal .icon-option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: scale(1.05);
}

.icon-color-picker-modal .icon-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

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

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

/* Subscription Badge */
.subscription-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.subscription-badge.free {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.subscription-badge i {
    font-size: 1rem;
}

.subscription-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
