/* ==========================================================================
   1. Base Styles
   ========================================================================== */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --background-color: #f0f4f8;
    --sidebar-color: #2c3e50;
    --sidebar-hover: #34495e;
    --border-color: #e1e8ed;
    --input-bg: #ffffff;
    --input-border: #cbd5e0;
    --success-color: #2ecc71;
    --info-color: #f1c40f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================================================
   2. Layout
   ========================================================================== */
.app-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    min-height: calc(100vh - 40px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-color);
    color: white;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    background-color: var(--sidebar-hover);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    margin-right: 10px;
    font-size: 18px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.tab-button {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.tab-button i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.tab-button:hover {
    background-color: var(--sidebar-hover);
}

.tab-button.active {
    background-color: var(--primary-color);
    position: relative;
}

.tab-button.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: white;
}

.sidebar-footer {
    padding: 15px;
    font-size: 12px;
    text-align: center;
    background-color: var(--sidebar-hover);
}

/* Main Content */
.main-content {
    flex: 1;
    background-color: white;
    padding: 0;
    position: relative;
    overflow-y: auto;
}

.content-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.content-header h1 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.content-header p {
    color: var(--text-light);
}

/* ==========================================================================
   3. Forms
   ========================================================================== */
.link-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    margin: 0 -10px 25px;
}

.form-group.half {
    flex: 1;
    padding: 0 10px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

label i {
    margin-right: 8px;
    color: var(--primary-color);
}

input[type="text"],
input[type="url"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    background-color: var(--input-bg);
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-light);
}

/* Input with prefix */
.input-with-prefix {
    display: flex;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    overflow: hidden;
}

.input-prefix {
    background-color: #f5f7fa;
    padding: 12px 15px;
    font-size: 15px;
    color: var(--text-light);
    border-right: 1px solid var(--input-border);
    white-space: nowrap;
}

.input-with-prefix input {
    flex: 1;
    border: none;
    border-radius: 0;
}

.input-with-prefix:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Radio button styling */
.radio-group {
    display: flex;
    gap: 15px;
}

.radio-option {
    position: relative;
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    cursor: pointer;
    padding: 10px 20px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.radio-option input[type="radio"]:focus + label {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-primary i {
    margin-right: 8px;
}

.btn-secondary {
    background-color: #f5f7fa;
    color: var(--text-color);
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* ==========================================================================
   4. Info and Result Boxes
   ========================================================================== */
.info-box {
    background-color: #f5f7fa;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 6px;
    margin: 30px 0;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.info-box h3 i {
    margin-right: 8px;
}

.info-box p {
    margin-bottom: 10px;
    color: var(--text-color);
}

.info-box ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.info-box li {
    margin-bottom: 5px;
    color: var(--text-color);
}

.code-sample {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 12px 15px;
    border-radius: 4px;
    font-family: monospace;
    margin: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
}

/* Result Section */
.result-section {
    border-top: 1px solid var(--border-color);
    background-color: #f5f7fa;
    padding: 30px;
}

.result-header {
    margin-bottom: 20px;
}

.result-header h2 {
    color: var(--success-color);
    display: flex;
    align-items: center;
}

.result-header h2 i {
    margin-right: 10px;
}

.result-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-field {
    display: flex;
    margin-bottom: 20px;
}

.result-field input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid var(--input-border);
    border-radius: 6px 0 0 6px;
    background-color: #f5f7fa;
    color: var(--primary-color);
    font-weight: 500;
}

.result-field .btn-secondary {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.result-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-light);
}

.info-item i {
    margin-right: 8px;
    color: var(--primary-color);
}

.info-item span {
    font-weight: 600;
    color: var(--text-color);
}

/* ==========================================================================
   5. Tab Content Management
   ========================================================================== */
.tab-content {
    display: none;
}

/* ==========================================================================
   6. Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .logo {
        padding: 15px 20px;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
    }
    
    .tab-button {
        flex: 1;
        justify-content: center;
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .tab-button i {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 20px;
    }
    
    .tab-button.active::before {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half {
        padding: 0;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .content-header, .link-form, .result-section {
        padding: 20px 15px;
    }
    
    .content-header h1 {
        font-size: 20px;
    }
    
    .input-prefix {
        font-size: 13px;
        padding: 12px 8px;
    }
    
    .result-field {
        flex-direction: column;
    }
    
    .result-field input {
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .result-field .btn-secondary {
        border-radius: 6px;
        border-left: 1px solid var(--input-border);
    }
}