/* ===================================
   CODE SNIPPET MANAGER - MODERN UI
   =================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    min-height: 100vh;
    padding: 20px;
}


.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================================
   TOP BAR
   =================================== */

.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}


.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}


/* ===================================
   BUTTONS
   =================================== */

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(48, 164, 221, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 164, 221, 0.6);
}


.btn-secondary {
    background: white;
    color: #88C62B;
    border: 2px solid #88C62B;
}

.btn-secondary:hover {
    background: #88C62B;
    color: white;
}

.back-btn {
    padding: 10px 20px;
    background: white;
    color: #88C62B;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #88C62B;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #88C62B;
    color: white;
}

/* ===================================
   SEARCH & FILTERS
   =================================== */

.search-filters {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #88C62B;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.filter-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    color: #666;
}

.filter-tag:hover,
.filter-tag.active {
    border-color: #88C62B;
    background: #88C62B;
    color: white;
}

/* ===================================
   SNIPPETS GRID
   =================================== */

.snippets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.snippet-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.snippet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.snippet-header {
    padding: 20px;
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    color: white;
}


.snippet-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.snippet-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    opacity: 0.9;
}

.meta-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.snippet-body {
    padding: 20px;
    flex: 1;
}

.snippet-tags {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f0f0f0;
    color: #88C62B;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* ===================================
   CODE CANVAS (macOS style)
   =================================== */

.code-canvas {
    background: #282c34;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.code-toolbar {
    background: #21252b;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #181a1f;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.code-lang {
    color: #abb2bf;
    font-size: 12px;
    font-weight: 500;
}

.code-content {
    max-height: 300px;
    overflow: auto;
    padding: 15px;
}

.code-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-content::-webkit-scrollbar-track {
    background: #282c34;
}

.code-content::-webkit-scrollbar-thumb {
    background: #4b5263;
    border-radius: 4px;
}

.code-content pre {
    margin: 0;
    background: transparent !important;
    padding: 0 !important;
}

.code-content code {
    font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* ===================================
   SNIPPET FOOTER
   =================================== */

.snippet-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

.snippet-date {
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.snippet-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
}

.action-btn.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn.edit:hover {
    background: #1976d2;
    color: white;
}

.action-btn.delete {
    background: #ffebee;
    color: #d32f2f;
}

.action-btn.delete:hover {
    background: #d32f2f;
    color: white;
}

.action-btn.copy {
    background: #f3e5f5;
    color: #7b1fa2;
}

.action-btn.copy:hover {
    background: #7b1fa2;
    color: white;
}

/* ===================================
   EMPTY STATE
   =================================== */

.empty-state {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 60px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 64px;
    color: #88C62B;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.empty-text {
    color: #666;
    margin-bottom: 25px;
}

/* ===================================
   FORM PAGES (Add/Edit)
   =================================== */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}


.form-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ff9800;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
}

.form-label .required {
    color: #d32f2f;
    margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #88C62B;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    min-height: 300px;
    background: #282c34;
    color: #abb2bf;
    line-height: 1.6;
}

.form-helper {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-group .btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
}

.btn-group .btn-primary {
    flex: 1;
}

.language-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.lang-tag {
    padding: 6px 14px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.lang-tag:hover {
    background: #88C62B;
    color: white;
}

/* ===================================
   LOGIN PAGE
   =================================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #30A4DD 0%, #88C62B 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(48, 164, 221, 0.4);
}


.login-logo i {
    font-size: 36px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    margin-bottom: 25px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
}

.login-footer {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.info-box {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #1976d2;
    align-items: flex-start;
}

.info-box i {
    font-size: 18px;
    flex-shrink: 0;
}

.info-box code {
    background: rgba(25, 118, 210, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .snippets-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
}